News:

  • September 30, 2026, 07:44:03 PM

Login with username, password and session length

Author Topic: DNSLOOKUP oddity  (Read 9144 times)

Andrew S

  • Hero Member
  • *****
  • Posts: 144
DNSLOOKUP oddity
« on: August 24, 2019, 10:39:45 AM »
I'm running DNSLOOKUP with 8.8.8.8 and 8.8.4.4 as the servers. I'm attempting to resolve an address (on a domain that I control) but it's failing. Because the system is still being tested I'm using an internal IP address which resolves correctly when I run nslookup on the two google servers.

I'm wondering if I'm getting tripped up by some sanity-checking in the function. Does it disallow private addresses on public servers to avoid dns cache poisoning?

The reality is that it's much more likely to be something stupid in my code but for the life of me I can't see it.
Andrew.

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: DNSLOOKUP oddity
« Reply #1 on: August 24, 2019, 12:22:16 PM »
Still struggling with this. I pointed the command to use an internal DNS server as the primary and made sure I could resolve the host on a PC - it failed. I changed the host to a different hostname on the local network but it still failed. At this point I can't make the command work at all. The PLC communicates fine for other network commands and I've double-checked the network setup of the PLC which appears to be fine. I've checked and double-checked the values I'm putting into the command and they seem ok. I'm using all lower-case hostnames (the same as defined in the DNS server) in case something odd's going on such as PLCNut saw in a previous post.

Stumped on a Saturday - can't be good....

Andrew.

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: DNSLOOKUP oddity
« Reply #2 on: August 24, 2019, 12:54:27 PM »
The reality is that it's much more likely to be something stupid in my code but for the life of me I can't see it.
A cautionary tale for those daft enough to be coding on a Saturday. Always make sure that "Automatically Insert Space" is switched off when you STRPRINT your hostname.

Where's that face-palm icon?...  :o

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: DNSLOOKUP oddity
« Reply #3 on: August 24, 2019, 02:31:27 PM »
That's one of the things that makes Quoted String format more helpful than ASCII format in Data View - you can see trailing spaces in Quoted String
"plcxyz "
vs
plcxyz

Editing in ASCII format is easier than Quoted String for simple text.  Quoted String requires the start/end double quotes, but it then also supports the $ escape sequence grammar, which is sometimes needed (but typically not for most text).

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: DNSLOOKUP oddity
« Reply #4 on: August 24, 2019, 03:13:55 PM »
Yes, quoted string is awesome. It's caught that exact problem (trailing space) for me on more than one occasion.