Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Name Resolution Issue, yet nslookup works [solved-properly]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
koan
Apprentice
Apprentice


Joined: 01 May 2006
Posts: 169
Location: Melbourne

PostPosted: Mon Jan 21, 2008 2:33 am    Post subject: Name Resolution Issue, yet nslookup works [solved-properly] Reply with quote

Hello,

I recently changed the domain name of my local network, and one of the gentoo boxes no longer will resolve names.

Its resolv.conf looks like this:

Code:

search=domain.local
nameserver=10.1.1.2
nameserver=10.1.1.20


The /etc/hosts file has the canonical name first for localhost:

Code:

127.0.0.1 name.domain.local name localhost



/etc/hosts.conf says:

Code:

order hosts, bind


If I dig or nslookup google.com, I get the correct address. However if I telnet or ping the same address, I get host unknown. Same for local addresses. The broken gentoo box is in the 10.1.1.0/24 range, and gets its ip from dhcp (from either 10.1.1.2 or 10.1.1.20)

I can direct nslookup to either of the dns servers for resolution, and they both provide answers to queries.

So gethostbyname is failing, but it looks like everything it needs is in place.

Any tips on how to troubleshoot this? Note that I did have resolvconf installed before, and uninstalled it to simlify things and to see if it was the source of the problem.

Thanks,

Paul[/code]


Last edited by koan on Mon Jan 21, 2008 9:04 pm; edited 2 times in total
Back to top
View user's profile Send private message
koan
Apprentice
Apprentice


Joined: 01 May 2006
Posts: 169
Location: Melbourne

PostPosted: Mon Jan 21, 2008 3:12 am    Post subject: Reply with quote

I have just seen the bug in baselayout 1.12.11 - I am using sys-apps/baselayout-1.12.10-r5 (0)

And my routing table is:
Code:

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.1.1.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         10.1.1.2        0.0.0.0         UG        0 0          0 eth0


So, not a routing issue
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23100

PostPosted: Mon Jan 21, 2008 4:22 am    Post subject: Reply with quote

Emerge dev-util/strace and use it to trace the failing resolution. Look for any failed system calls. If I had to guess, I would start with checking whether the permissions on /etc/resolv.conf allow it to be read by the user running telnet.
Back to top
View user's profile Send private message
koan
Apprentice
Apprentice


Joined: 01 May 2006
Posts: 169
Location: Melbourne

PostPosted: Mon Jan 21, 2008 5:09 am    Post subject: Reply with quote

Thanks Hu,

The problem was exhibited for root also.

Cheers for the strace tip, I noticed that the resolution sequence called to avahi. I am not using avahi for anything, and once it was out of the picture, everything worked fine.

Paul
Back to top
View user's profile Send private message
koan
Apprentice
Apprentice


Joined: 01 May 2006
Posts: 169
Location: Melbourne

PostPosted: Mon Jan 21, 2008 9:06 pm    Post subject: Reply with quote

Uh no.

Wrong. Taking avahi out of the picture only solved things for "ping". Most other things still could not resolve.

Turned out that libnss_dns.so.2 was missing. A re-emerge of glibc rectified that...
Back to top
View user's profile Send private message
qriff
n00b
n00b


Joined: 04 Dec 2003
Posts: 73

PostPosted: Sun May 25, 2008 8:49 pm    Post subject: Reply with quote

This is directly related to the /etc/resolv.conf line:
Code:
search domain.local


where setting a top-level domain of .local will fail.

Dont know why.

This also affects Sabayon.
Back to top
View user's profile Send private message
yuhu
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2006
Posts: 86

PostPosted: Thu Jul 17, 2008 7:17 am    Post subject: Reply with quote

this is the answer

Quote:
http://www.avahi.org/wiki/AvahiAndUnicastDotLocal


workaround: change in /etc/nsswitch.conf

Quote:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4


to

Quote:
hosts: files dns mdns4


this will solve not all problems, but for me it works
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum