2

I've configured the DNS settings for a host (admin.example-preprod.foobar.it with IP 100.100.100.100) but it does not resolve from every server I try (it does for some).

For example, I'm on a server which uses the following 3 DNS servers:

foobar@server:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 200.200.200.1
nameserver 200.200.200.2
nameserver 200.200.200.3

dig works for all of them.

first:

foobar@server:~$ dig admin.example-preprod.foobar.it @200.200.200.1

; <<>> DiG 9.9.5-3ubuntu0.7-Ubuntu <<>> admin.example-preprod.foobar.it @200.200.200.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6540
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;admin.example-preprod.foobar.it.        IN      A

;; ANSWER SECTION:
admin.example-preprod.foobar.it. 86400 IN A      100.100.100.100

;; AUTHORITY SECTION:
foobar.it.               86400   IN      NS      qwert.foobar.it.
foobar.it.               86400   IN      NS      ns0.xname.org.
foobar.it.               86400   IN      NS      ns1.xname.org.

;; ADDITIONAL SECTION:
qwert.foobar.it.         86400   IN      A       200.200.200.1

;; Query time: 46 msec
;; SERVER: 200.200.200.1#53(200.200.200.1)
;; WHEN: Fri Nov 04 10:35:46 EET 2016
;; MSG SIZE  rcvd: 156

second:

foobar@server:~$ dig admin.example-preprod.foobar.it @200.200.200.2

; <<>> DiG 9.9.5-3ubuntu0.7-Ubuntu <<>> admin.example-preprod.foobar.it @200.200.200.2
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 40127
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;admin.example-preprod.foobar.it.        IN      A

;; AUTHORITY SECTION:
foobar.it.               85817   IN      SOA     qwert.foobar.it. webmaster.foobar.it. 2016092901 10800 900 1814400 10800

;; Query time: 3 msec
;; SERVER: 200.200.200.2#53(200.200.200.2)
;; WHEN: Fri Nov 04 10:36:05 EET 2016
;; MSG SIZE  rcvd: 111

third:

foobar@server:~$ dig admin.example-preprod.foobar.it @200.200.200.3

; <<>> DiG 9.9.5-3ubuntu0.7-Ubuntu <<>> admin.example-preprod.foobar.it @200.200.200.3
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2392
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;admin.example-preprod.foobar.it.        IN      A

;; ANSWER SECTION:
admin.example-preprod.foobar.it. 86400 IN A      100.100.100.100

;; AUTHORITY SECTION:
foobar.it.               86400   IN      NS      qwert.foobar.it.
foobar.it.               86400   IN      NS      ns1.xname.org.
foobar.it.               86400   IN      NS      ns0.xname.org.

;; ADDITIONAL SECTION:
qwert.foobar.it.         81845   IN      A       200.200.200.1

;; Query time: 2309 msec
;; SERVER: 200.200.200.3#53(200.200.200.3)
;; WHEN: Fri Nov 04 10:35:56 EET 2016
;; MSG SIZE  rcvd: 156

but then, when I try to ping it gives me unknown host:

foobar@server:~$ ping admin.example-preprod.foobar.it
ping: unknown host admin.example-preprod.foobar.it

How is that possible and where should I look at to solve the problem?

  • Can you add the output of cat /etc/nsswitch.conf to your question. – Thomas Nov 4 '16 at 10:39
  • What's the version of Linux on the clients? Are you using nscd on the clients? What do you get as output from getent hosts admin.example-preprod.foobar.it – Paul Haldane Nov 4 '16 at 10:41
  • @Thomas it's the default in ubuntu 14.04.4: pastebin.com/raw/y6Eiva0W – cherouvim Nov 4 '16 at 11:40
  • @PaulHaldane vanilla Ubuntu 14.04.4 LTS. No, nscd is not installed.The output of that command is empty but doing getent hosts www.google.com gives me 2607:f8b0:4002:806::2004 www.google.com. – cherouvim Nov 4 '16 at 11:42
1

dig doesn't work for all of them - your second nameserver (200.200.200.2 in your example) isn't resolving the record.

The Linux resolver randomises between entries in resolv.conf by default and I'd guess your ping has hit the failing resolver.

  • It's not resolving it but it is providing a way to resolve it (giving the SOA), isn't that right? – cherouvim Nov 4 '16 at 11:38
  • 1
    Nope - look at the status of the answer from that server - NXDOMAIN. That means it is authoritative for the zone and knows that the record doesn't exist. – Paul Haldane Nov 4 '16 at 16:19
  • Given that these nameservers are general system resolvers I'd consider that one out of three disagreeing with the majority points to a problem with that resolver. – James Yale Nov 4 '16 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.