Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Odd DNS resolution issues
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
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Sun Nov 21, 2010 5:52 pm    Post subject: Odd DNS resolution issues Reply with quote

I haven't used my Linux system in a while, and it has always been working fine until recently when I last booted into it, I'm having a really odd issue with my network connection.

Essentially, I can ping any domain (e.g. google.com) and the name is resolved and I get ICMP responses.

But if I try to load up any other software such as wget, or Firefox, they fail to resolve anything. What I can do, of course, is pull the IP address that I see from the output of ping and use that to connect to the servers, but this is hardly a solution.

I'm not sure what's gone wrong. Any thoughts would be appreciated!
_________________
rcxAsh
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2567

PostPosted: Sun Nov 21, 2010 6:00 pm    Post subject: Reply with quote

Please show us the contents of /etc/resolv.conf and ifconfig and netstat -rn
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Sun Nov 21, 2010 6:34 pm    Post subject: Reply with quote

Here's what I see:
Code:

cha ~ # cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.254

Code:

cha ~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:09:c9:a3:c9
          inet addr:192.168.12.103  Bcast:192.168.12.255  Mask:255.255.255.0
          inet6 addr: fe80::211:9ff:fec9:a3c9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2383 errors:0 dropped:0 overruns:0 frame:0
          TX packets:470 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:246672 (240.8 KiB)  TX bytes:43687 (42.6 KiB)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Code:

cha ~ # netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.12.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         192.168.12.1    0.0.0.0         UG        0 0          0 eth0
cha ~ #

The DNS server of 192.168.1.254 is my DSL modem, which my router hangs off of. My Windows laptop uses the same DNS server.

Again the strange thing is that DNS resolution is working on my Linux box - but only for PING. Other applications are not resolving anything!

Consider this output, which was run one after the other:
Code:

ashley@cha ~ $ ping -c 2 google.com
PING google.com (74.125.95.104) 56(84) bytes of data.
64 bytes from iw-in-f104.1e100.net (74.125.95.104): icmp_seq=1 ttl=49 time=26.6 ms
64 bytes from iw-in-f104.1e100.net (74.125.95.104): icmp_seq=2 ttl=49 time=26.3 ms

--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 26.374/26.534/26.694/0.160 ms

ashley@cha ~ $ wget google.com
--2010-11-21 13:34:22--  http://google.com/
Resolving google.com... failed: Temporary failure in name resolution.
wget: unable to resolve host address `google.com'
ashley@cha ~ $

_________________
rcxAsh
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15977

PostPosted: Sun Nov 21, 2010 9:03 pm    Post subject: Reply with quote

What if you do wget -4 instead of just wget?
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Sun Nov 21, 2010 9:08 pm    Post subject: Reply with quote

That seemed to work! So I somehow my system is trying to use IPv6? I do notice in my /var/log/messages that there is a line saying "kernel: eth0: no IPv6 routes present" when I start the network service.

Should I disable IPv6 for the time being? I'm not so sure why I'm experiencing this now - unless it's on my ISP or new DSL modem side of things?
_________________
rcxAsh
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15977

PostPosted: Sun Nov 21, 2010 10:33 pm    Post subject: Reply with quote

Some braindead DSL modems are known to cause problems when using IPv6. Most likely, your modem's built in DNS server misbehaves when asked for an IPv6 AAAA record. You can use ping because it only ever requests IPv4 A records. Disabling IPv6 should work around the problem for now, but you may want to look into finding a properly behaved DNS server, too.
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Sun Nov 21, 2010 11:35 pm    Post subject: Reply with quote

Thanks for the help. Things are working for now with IPv6 disabled. I might have to see if I can configure my modem differently, to maybe let my router handle everything instead.
_________________
rcxAsh
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1409
Location: Adelaide/Australia

PostPosted: Sun Nov 21, 2010 11:59 pm    Post subject: Reply with quote

I find my ADSL modem, very occasionally, gets it's knickers in a twist with regards to DNS.
I re-boot the modem and things return to normal.
_________________
...Lyall
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1404
Location: Montréal

PostPosted: Mon Nov 22, 2010 12:23 am    Post subject: Reply with quote

Sorry,
but I do not understand how you can join a local DNS server 192.168.1.254 with no local route that allow you to do so. You have two configured networks, 192.168.12.0/24 and 127.0.0.0/8 but not 192.168.1.0/24. If your local network is configured by DHCP something is wrong. Can you
Code:
ping -c 4 192.168.1.254


A workaround I think would be to put reals Internet DNS servers like the ones of your ISP or Open DNS in /etc/resolv.conf or reconfigure the network and/or the router.
_________________
Paul


Last edited by Logicien on Mon Nov 22, 2010 12:48 am; edited 4 times in total
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Mon Nov 22, 2010 12:31 am    Post subject: Reply with quote

Logicien wrote:
Sorry,
but I do not understand how you can join a local DNS server 192.168.1.254 with no local route that allow you to do so. You have two configured networks, 192.168.12.0/24 and 127.0.0.0/8 but not 192.168.1.0/24. If your local network is configured by DHCP something is wrong. Can you
Code:
ping -c 4 192.168.1.254


A workaround I think would be to put reals Internet DNS servers like the ones of your ISP or Open DNS in /etc/resolv.conf or reconfigure the network and/or the router.

In my setup, the modem connects to the internet and assigns an internal network IP address to my router. This is in the 192.168.1.*** range. My computers then connect to my router, which assigns addresses to them in the 192.168.12.*** range. Since the computers are behind the router, then can reach out to the modem, and subsequently the internet. It's like there are two layers of NAT that I have - one on the modem, and then one on my router. (Although the modem only has one RJ45 connector on it).

I have things working now as per the IPv6 comments as pointed out by Hu. I'd like to keep DHCP as the main method for assigning my addresses, so I'll probably let NetworkManager or dhcpcd work out the resolv.conf file for itself for the time being. Thanks for the tip though!
_________________
rcxAsh
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15977

PostPosted: Mon Nov 22, 2010 12:56 am    Post subject: Reply with quote

When using dhcpcd, you can selectively override parts of the DHCP configuration. This would allow you to use DHCP for most things, but still force a DNS server of your choosing. You could also look at the documentation for your router to see if you can tell it to offer a different set of DNS servers.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Mon Nov 22, 2010 8:31 am    Post subject: Reply with quote

Sorry to jump in here like that, but I have a question for the OP:

if you do this:
Code:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1


does it really disable IPv6 for you? (ie: does wget http://google.com work? without -4, I mean)
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Wed Nov 24, 2010 1:58 am    Post subject: Reply with quote

I've rebuilt wget without ipv6 and also disabled ipv6 at the kernel module level, so I will have to put it back in to try for you. Might not be this week though as I'm going to be away, but I'll see if I can give it a try next week!
_________________
rcxAsh
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Nov 24, 2010 3:45 am    Post subject: Reply with quote

wow, thanks rcxAsh, this is just out of curiosity, so I feel bad if you go in that much trouble for me :S

I was actually asking this, because I'me not sure what this sysctl settings really does and how applications/services change their behaviour accordingly. Some of them seem to try some IPv6 things anyway, which I found weird?!
_________________
The End of the Internet!
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Sun Dec 05, 2010 6:51 pm    Post subject: Reply with quote

Hey again, sorry it took a while to reply, I was rebuilding my system.

At any rate, putting back IPv6, I then tried the command:
Code:
sysctl -w net.ipv6.conf.all.disable_ipv6=1

But wget still required the -4 option to resolve things. All other applications that seemed to be failing to resolve due to my modem not properly supporting IPv6 were not working either.

Is this behaviour unexpected?
_________________
rcxAsh
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Mon Dec 06, 2010 8:21 am    Post subject: Reply with quote

rcxAsh wrote:
Is this behaviour unexpected?


Ok, same here. I'm no kernel expert but I thought disabling ipv6 would prevent applications from trying it.

This is kinda weird, isn't it?

Thanks rcxAsh!
_________________
The End of the Internet!
Back to top
View user's profile Send private message
rahulthewall
Veteran
Veteran


Joined: 01 Nov 2007
Posts: 1264
Location: Zürich

PostPosted: Mon Dec 06, 2010 9:07 am    Post subject: Reply with quote

truc wrote:
rcxAsh wrote:
Is this behaviour unexpected?


Ok, same here. I'm no kernel expert but I thought disabling ipv6 would prevent applications from trying it.

This is kinda weird, isn't it?

Thanks rcxAsh!


Had the same problem with DNS and IPv6. I blacklisted IPv6 (and the module was not loaded) but the DNS issues persisted. The only solution was to build everything with USE="-ipv6".
_________________
Who shall guard the guards?
Back to top
View user's profile Send private message
rcxAsh
Guru
Guru


Joined: 03 Jul 2003
Posts: 457
Location: /etc/localtime

PostPosted: Mon Dec 06, 2010 10:51 pm    Post subject: Reply with quote

That is kind of strange! At least we know we're not going crazy :P It seems like it would have been good or expected that if IPv6 routes failed, that it could at least try to fall back to IPv4.

At any rate, my longer term fix has been to manually enter the DNS servers into my router that the modem gets from my ISP rather than letting the router hand off the DNS serving to the modem which seems a bit buggy that way. That way I've been able to re-enable IPv6.

Thanks for all the tips, everyone.
_________________
rcxAsh
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