LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Internet routing delay (https://www.linuxquestions.org/questions/linux-newbie-8/internet-routing-delay-422457/)

zCut 03-07-2006 09:44 AM

Internet routing delay
 
Hi,
I'm quite new to linux and very new to this forum. And here is my problem: It seems, that there is somthing misconfigured with network settings, because most of the time, when I want to connect to a remote server (no matter what kind of server) I get an annoying delay of up to ten seconds before I can resolve the hostname. I'm using a DSL-Router and don't have this problem under the other OS. I don't use a personal firewall and here are some outputs:
Code:

$ route
localnet        *              255.255.255.0  U    0      0        0 eth1
default        192.168.0.1    0.0.0.0        UG    0      0        0 eth1

$ route -n
192.168.0.0    0.0.0.0        255.255.255.0  U    0      0        0 eth1
0.0.0.0        192.168.0.1    0.0.0.0        UG    0      0        0 eth1

$ ifconfig
eth1      Protokoll:Ethernet  Hardware Adresse 00:80:AD:7D:27:5A
          inet Adresse:192.168.0.4  Bcast:192.168.0.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15689 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17226 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:43 Sendewarteschlangenlänge:1000
          RX bytes:10534212 (10.0 MiB)  TX bytes:2573706 (2.4 MiB)
          Interrupt:19 Basisadresse:0x9000

lo        Protokoll:Lokale Schleife
          inet Adresse:127.0.0.1  Maske:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:134 errors:0 dropped:0 overruns:0 frame:0
          TX packets:134 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0
          RX bytes:14021 (13.6 KiB)  TX bytes:14021 (13.6 KiB)

Any help or hint is really welcome! Thanks
zCut

_KDF 03-07-2006 10:01 AM

Check your DNS servers, a non existent or offline DNS server can cause simmilar problems.

cat /etc/resolv.conf

if you have 2 dns servers try swapping them around and see if that solves the problem.

zCut 03-07-2006 10:11 AM

Thanks for your quick reply, but that file only contains:
Code:

nameserver 192.168.0.1
That is my router and so I think, this should be ok. Any other idea?

_KDF 03-07-2006 10:34 AM

Try changing the /etc/resolv.conf to your ISP's DNS server IP's manually and see if that fixes the delay problem. My guess is it will.

eg.

nameserver 1.2.3.4
nameserver 2.3.4.5


Change the above IP's to valid DNS servers.

Emerson 03-07-2006 10:39 AM

You can do dig www.google.com and see how long it takes and which server is responding.

marozsas 03-07-2006 10:58 AM

Check your /etc/nsswitch.conf
 
Check your /etc/nsswitch.conf file, too.
The hosts entry must be "files dns".
A entry like "file nis ldap dns" would introduce those delays you are reporting.

zCut 03-07-2006 12:01 PM

First I want to thank all of you for your effort, but the problem still remains:
Quote:

Originally Posted by _KDF
Try changing the /etc/resolv.conf to your ISP's DNS server IP's manually and see if that fixes the delay problem. My guess is it will.

I tried that, but actually it doesn't seem to have any effect, so I changed it back... But anyways, thanks for that suggstion!

Quote:

Originally Posted by Emerson
You can do dig [I cannot post the URL] and see how long it takes and which server is responding.

That gave me the following output:
Code:

...

;; Query time: 17 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Mar  7 17:30:34 2006
;; MSG SIZE  rcvd: 111

I don't know how that "Query time" is measured but actually it took me several seconds before I got any response. I cannot post URLs, because I don't have 5 posts so far, so I had to shorten the output a bit, but what else should it show to me, that may help?

@marozsas
The "hosts" in my '/etc/nsswitch.conf' is already "files dns".

Another thing: I don't get this annoying delay everytime. And actually I'm not able to find any pattern in it. Sometimes it works, but more often it does not. And when I once resolved the host, the second time doesn't make any trouble..., only the first one.

marozsas 03-07-2006 12:29 PM

Quote:

Originally Posted by zCut
That is my router and so I think, this should be ok. Any other idea?

This is odd. Routers are not Domain Name Servers. This make sense for anyone else ?

Try to find a real DNS server and put its IP in the resolv.conf file.

Another idea. Run your own Name server. The default configuration for the most distros are cache only, which is just fine for you. What distro is yours ?

zCut 03-07-2006 01:29 PM

Quote:

Originally Posted by marozsas
This is odd. Routers are not Domain Name Servers. This make sense for anyone else ?

Try to find a real DNS server and put its IP in the resolv.conf file.

This may be odd, but I have to say, that it is may neighbour who actually "owns" the internet connection and set up the network. So I have no details how it works, but it works ...for several years now. But as I said, after _KDF suggested me the same thing, I also tried two of the official DNS severs of our ISP and there was no difference.

Quote:

Another idea. Run your own Name server. The default configuration for the most distros are cache only, which is just fine for you. What distro is yours ?
I'm using Ubuntu (breezy). Can you pleas explain how to run my own nameserver. What do I have to enter where? Thank you

marozsas 03-07-2006 01:47 PM

Quote:

Originally Posted by zCut
I'm using Ubuntu (breezy). Can you pleas explain how to run my own nameserver. What do I have to enter where? Thank you

I'm not a Ubuntu expert, but the in general, there is a script named "bind" or "named" in /etc/init.d. If it is there, type:
Code:

# /etc/init.d/named start
to test:
Code:

$ dig @localhost www.google.com
if it works (there is a NOERROR in the header section), than put 127.0.0.1 in your /etc/resolv.conf.

I hope this helps,

zCut 03-07-2006 02:13 PM

That script (/etc/init.d/bind9) already runs at startup and yes, adding 127.0.0.1 to /etc/resolv.conf seems really to make things better: The delay is shortened to 2-3 seconds now, which is ok for me, although I have no clue why this helped? Mmmh..., strange..., and I just checked, there is still no such delay under Wind**s (where I use the same DNS). But as I said: I can live with this short delay and am really grateful for all your help.

thanks
zCut


All times are GMT -5. The time now is 12:44 PM.