View previous topic :: View next topic |
Author |
Message |
koan Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/81308783053ba9f65e02b9.png)
Joined: 01 May 2006 Posts: 169 Location: Melbourne
|
Posted: Mon Jan 21, 2008 2:33 am Post subject: Name Resolution Issue, yet nslookup works [solved-properly] |
|
|
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:
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 |
|
![](templates/gentoo/images/spacer.gif) |
koan Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/81308783053ba9f65e02b9.png)
Joined: 01 May 2006 Posts: 169 Location: Melbourne
|
Posted: Mon Jan 21, 2008 3:12 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23100
|
Posted: Mon Jan 21, 2008 4:22 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
koan Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/81308783053ba9f65e02b9.png)
Joined: 01 May 2006 Posts: 169 Location: Melbourne
|
Posted: Mon Jan 21, 2008 5:09 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
koan Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/81308783053ba9f65e02b9.png)
Joined: 01 May 2006 Posts: 169 Location: Melbourne
|
Posted: Mon Jan 21, 2008 9:06 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
qriff n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 04 Dec 2003 Posts: 73
|
Posted: Sun May 25, 2008 8:49 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
yuhu Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 17 Oct 2006 Posts: 86
|
Posted: Thu Jul 17, 2008 7:17 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|