0

I am still learning linux, and so far having great trouble in the networking and DNS areas - I think due to misunderstandings.

My understanding is if we provide nameservers in /etc/resolv.conf these will be used when trying to resolv domains.

Therefore if I specify a dead nameserver such as

nameserver 452.102.210.88

when running the following code, shouldn't we get a result like timed out, or couldn't find etc...

host google.com

Instead we get

google.com has address 74.125.230.98
google.com has address 74.125.230.99
...

I expected that as we have a broken DNS "phonebook", when host cmd tries to get info on google.com it shouldn't be able to get any IP. Apparently not.

nslookup google.com

Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   google.com
Address: 74.125.230.99
Name:   google.com
Address: 74.125.230.100
....

dig google.com

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43950
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             188     IN      A       74.125.230.101
google.com.             188     IN      A       74.125.230.102
...

;; AUTHORITY SECTION:
google.com.             170629  IN      NS      ns1.google.com.
google.com.             170629  IN      NS      ns2.google.com.
...

;; ADDITIONAL SECTION:
ns1.google.com.         170629  IN      A       216.239.32.10
ns2.google.com.         170629  IN      A       216.239.34.10
...

;; SERVER: 127.0.0.1#53(127.0.0.1)
...

/etc/hosts

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       raspberrypi

/etc/network/interfaces

...
dns-nameservers 452.102.210.88 (dead dns)
dns-search home.lan
dns-domain home.lan
...
  • Can you share the output of nslookup google.com and dig google.com ns ? – Sree Dec 23 '14 at 2:03
  • @Sree updated, seems to show some localhost activity... – UnixUnix Dec 23 '14 at 2:11
  • This looks like google.com is getting resolved from some cache on your server. Is there a nameserver 127.0.0.1 entry in your resolv.conf ? Could you restart /etc/init.d/nscd and check whether google.com is still resolving? I assume there are no entries in the /etc/hosts file. – Sree Dec 23 '14 at 2:16
  • @Sree /etc/resolv.conf has only one entry(the non-repsonsive dead NS), I couldnt seem to run /etc/init.d/nscd so I rebooted the whole machine, Is this sufficent? I have appendded /etc/hosts contents to my original post, along with /etc/network/interfaces - where I placed the non-responsive dead nameserver too. – UnixUnix Dec 23 '14 at 2:21
  • Do you use Network Manager? Can you paste contents of /etc/NetworkManager/NetworkManager.conf? – kirill-a Dec 23 '14 at 10:54
1

You have failed to change the nameserver in resolve.conf to a "dead" namesever. Instead you put in an invalid IP address which cannot be properly parsed. Your old nameserver is probably 127.0.0.1 and is still being used. Try some ip address like 227.0.0.1 and you should get the result you are looking for.

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.