[SLUG] dns lookup with host works, other apps doesn't.
Hi all, I have a number machines sitting in another country with access to them via a VPN. On one of these machines host www.google.com returns valid IP addresses, but wget www.google.com results in Resolving www.google.com... failed: Temporary failure in name resolution. However, using wget with the IP address does work. Attempting to access other servers results in similar behaviour. host server works, wget server doesn't, wget ip address does. In addition, the problem is not restricted to wget; telnet, ping, lynx etc are all broken, but host works. Anybody have any explanation for this weird behaviour? Erik -- +---+ Erik de Castro Lopo +---+ http://en.wikipedia.org/wiki/Why_I_Am_Not_a_Christian http://en.wikipedia.org/wiki/Why_I_Am_Not_a_Muslim http://en.wikipedia.org/wiki/Strong_atheism -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] dns lookup with host works, other apps doesn't.
Hey hey. On Wed, 2007-02-21 at 13:24 +1100, Erik de Castro Lopo wrote: I have a number machines sitting in another country with access to them via a VPN. On one of these machines host www.google.com returns valid IP addresses, but wget www.google.com results in Resolving www.google.com... failed: Temporary failure in name resolution. However, using wget with the IP address does work. Attempting to access other servers results in similar behaviour. host server works, wget server doesn't, wget ip address does. In addition, the problem is not restricted to wget; telnet, ping, lynx etc are all broken, but host works. Anybody have any explanation for this weird behaviour? How is your /etc/nsswitch.conf ? This file controls how name resolution for different things is done. A default Linux install will most likely include the line hosts: files dns Which says that to resolve a hostname, first check /etc/hosts, then do a DNS lookup. If you take dns off of this line, then nothing on your system will do DNS lookups any more. Except tools like host, which are designed specifically for doing DNS lookups, and don't seem to jump through the standard hoops to resolve an address. -- Pete -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] dns lookup with host works, other apps doesn't.
Peter Hardy wrote: How is your /etc/nsswitch.conf ? Sorry, should have mentioned that I already looked at this. This file controls how name resolution for different things is done. A default Linux install will most likely include the line hosts: files dns hosts:files dns mdns Is the mdns ok? Erik -- +---+ Erik de Castro Lopo +---+ The phrase object-oriented means a lot of things. Half are obvious, and the other half are mistakes. -- Paul Graham -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] dns lookup with host works, other apps doesn't.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Erik de Castro Lopo wrote: Anybody have any explanation for this weird behaviour? perhaps you've got the http_proxy environment variable set to something invalid? - -- dave. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFF266jhPPdWeHRgaoRApMKAKCOFn3GlbN0W+Dh5BET3DDU9uk7tQCgsI3v pxnM+1iZ70pj8Q9yJ9nTgAg= =aGzf -END PGP SIGNATURE- -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] dns lookup with host works, other apps doesn't.
David Gillies wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Erik de Castro Lopo wrote: Anybody have any explanation for this weird behaviour? perhaps you've got the http_proxy environment variable set to something invalid? Sorry, that doesn't explain the behaviour. doesn't work does work wget server.namewget ip address telnet server.name telnet ip address I don't believe that telnet honours the http_proxy variable :-). Erik -- +---+ Erik de Castro Lopo +---+ Incompetence, like misery, seeks company. -- Erik Naggum -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] dns lookup with host works, other apps doesn't.
On Wed, Feb 21, 2007 at 01:24:01PM +1100, Erik de Castro Lopo wrote: Anybody have any explanation for this weird behaviour? No, but I bet the strace/ltrace output would give a good clue as to where the problem was happening. -i -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] dns lookup with host works, other apps doesn't.
On Wed, 2007-02-21 at 13:50 +1100, Erik de Castro Lopo wrote: Peter Hardy wrote: How is your /etc/nsswitch.conf ? Sorry, should have mentioned that I already looked at this. This file controls how name resolution for different things is done. A default Linux install will most likely include the line hosts: files dns hosts:files dns mdns Is the mdns ok? All I know about mdns is what I learnt from the last five minutes googling. :-) It's probably worth trying, especially if you know you don't need or don't use the libnss-mdns package. -- Pete -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html