LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-07-2004, 08:42 PM   #1
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Rep: Reputation: 30
Host lookup takes exceptionally long time


Hi there,

I'm having a problem with my Internet access. Whenever I request a page on any web browser, it takes at least six seconds to look up the host name. Even if I am traveling between pages on the same server. I do not get this problem when I am in Windows. I am currently using Mandrake 9.2.

Here is my hosts file:

127.0.0.1 localhost
127.0.0.1 CPE002078...

CPE002078... is the string of characters in my bash prompt after my user name (e.g. vicente@CPE002078...). If I leave this line out, GNOME gives me an error message every time I log on.

Here is my resolv.conf:
search bloor.phub.net.cable.rogers.com
nameserver 24.153.22.195
nameserver 24.153.23.66

My internet connection is set up in Mandrake as a LAN. Is this a problem? Because I am really using a cable modem.

What do you think is the problem?
 
Old 01-08-2004, 01:23 AM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
What's your /etc/nsswitch.conf file look like?

Also, because you really won't be looking for anything under "bloor.phub.net.cable.rogers.com" you can take that out.

> grep host /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files dns

And you can always try swapping the two nameservers.
 
Old 01-08-2004, 01:35 PM   #3
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
Here is my nsswitch.conf file:

passwd: files nisplus nis
shadow: files nisplus nis
group: files nisplus nis
hosts: files nisplus nis dns
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: nisplus
publickey: nisplus
automount: files nisplus
aliases: files nisplus

What do you suggest?

So I don't need the bloor.phub.net.cable.rogers.com? Rogers Cable is my cable company though.
 
Old 01-09-2004, 12:00 AM   #4
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
What search does in your resolve.conf is this.

Say I want to telnet to pariah under the technoslave.net domain. If I don't have search technoslave.net in there, then I need to type telnet pariah.technoslave.net, if I have search technoslave.net in my resolv.conf file, then all I'd need to type is telnet pariah

I doubt you'll be trying to get in to any hosts on your network via some type of domain name system.

Second, in your nsswitch.conf file, you can get rid of nisplus and nis ( for everything ), and then I'd swap files with dns, so that your hosts line looks like -

hosts: dns files

If you're still experiencing problems, then you can switch the IP addresses for your nameservers...it's possible that those nameservers are under load, so might be slow in responding.
 
Old 01-09-2004, 01:08 AM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
I agree with everything Technoslave wrote, except for the part of putting dns before files. That would prevent you from overriding certain hosts by putting an entry in /etc/hosts. Personally I very much like the ability to "lie" to my machine if I want to and override certain thing (like resolving sitefinder.verisign.net to 127.0.0.1, etc). It won't cause any perceivable delay because it just has to take a quick peek in a tiny file. With nis and nisplus, you have to wait for an nis query to file which will definitely take time (for each).
 
Old 01-09-2004, 06:42 PM   #6
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
Thanks. What do nis and nisplus do and when would I ever need those options there?
 
Old 01-09-2004, 09:15 PM   #7
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
Chort, I too have files before dns, however, I don't think that this individual will be doing this...if he does, then great, but I really don't think it's going to be the case.

NIS was/is a Sun thing ( I believe ) a sort of login manager ( a little more than that...but if you want the real skinny, man -k nis, then go to town ), that used unencrypted passwords. NIS+ is the same thing, but with encrypted passwords. I don't use it, nor have I ever in the 10+ years I've been doing UNIX admin work...but I'm sure someone, somewhere does.
 
Old 01-12-2004, 12:59 AM   #8
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
Ok, I took out the nis and nisplus entries but I've still got the same slow speed.

Any ideas?
 
Old 01-12-2004, 01:50 AM   #9
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Whenever I request a page on any web browser, it takes at least six seconds to look up the host name. Even if I am traveling between pages on the same server.
Hold on a second, I missed this the first time (I thought it said "except if I am..."). This wouldn't be a DNS resolution problem, then. It doesn't have to resolve DNS again each time you make a GET request to the same host. You have some other problem. Have you looked at the output of ifconfig eth0 to see if you have errors or collisions?
 
Old 01-13-2004, 06:19 PM   #10
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
Here's my output from the ifconfig command:

eth0 Link encap:Ethernet HWaddr 00:20:78:059:7A
inet addr:65.63.89.53 Bcast:65.63.89.127 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:221 errors:0 dropped:0 overruns:0 frame:0
TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:87042 (85.0 Kb) TX bytes:20858 (20.3 Kb)
Interrupt:3 Base address:0xd800

lo
.
.
.

What should I do?

Edit: Actually, most of the time pages on the same host load quickly but occasionally it takes as long as pages on other hosts. So it might not have to do with collisions.

Last edited by vincebs; 01-13-2004 at 06:22 PM.
 
Old 01-13-2004, 08:35 PM   #11
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Well then, try timing DNS requests.

You can do
$ time host www.google.com
(although that's likely to be cached and retrieved very fast)

$ time host thinkofsomeobscuredomainhere.tld
etc...

The point of this would be to determine if it really is the DNS resolution portion that is taking a long time. Of course, network latency could still have something to do with it. After you resolve the host, try pinging it and see what the latency is.

The last thing you can try is downloading pages with wget and time that as well. This would narrow it to potentially a problem with the browser you're using.
 
Old 01-14-2004, 12:44 AM   #12
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
Hmm, I guess DNS is not the problem:

[root@CPE00207805d97a-CM000a7369e75e root]# time host google.com
google.com has address 216.239.57.99
google.com has address 216.239.37.99
0.03user 0.00system 0:01.21elapsed 2%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (330major+223minor)pagefaults 0swaps
[root@CPE00207805d97a-CM000a7369e75e root]# time host linuxquestions.org
linuxquestions.org has address 64.179.4.146
0.03user 0.00system 0:01.10elapsed 2%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (330major+223minor)pagefaults 0swaps
[root@CPE00207805d97a-CM000a7369e75e root]# time host thestar.com
thestar.com has address 192.206.150.204
0.03user 0.01system 0:01.06elapsed 3%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (329major+222minor)pagefaults 0swaps
[root@CPE00207805d97a-CM000a7369e75e root]# time host www.cia.gov
www.cia.gov is an alias for www.odci.gov.
www.odci.gov has address 198.81.129.100
0.04user 0.01system 0:01.05elapsed 4%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (330major+223minor)pagefaults 0swaps
[root@CPE00207805d97a-CM000a7369e75e root]# time host www.distrowatch.com
www.distrowatch.com is an alias for distrowatch.com.
distrowatch.com has address 66.111.55.60
0.04user 0.01system 0:01.05elapsed 4%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (330major+223minor)pagefaults 0swaps

But then why does it take 6 seconds to "resolve" every host? This does not happen in Windows.
 
Old 01-18-2004, 07:03 PM   #13
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
Anyone?
 
Old 01-20-2004, 10:09 PM   #14
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 496

Original Poster
Rep: Reputation: 30
So DNS is not my problem. Then why does it take so long the resolve the host? This is getting really annoying.
 
Old 01-20-2004, 10:16 PM   #15
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
DNS IS host resolution. It must be either your browser or OS configuration.

By the way, I've never seen time output in that format before, but if it's in the format minutes:seconds.miliseconds, then you have problems. That would indicating that it's taking over a second just to resolve the hostname. That is slooooow. I'm not sure if I'm interpreting the output correctly, though. Check your man page for a description of the output fields.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
takes long time to load the KDE bruse Linux - Newbie 14 10-03-2005 03:29 PM
login takes long time doorman007 Linux - Software 2 04-25-2005 12:56 AM
Bzipping takes a really long time sometimes scott_R General 0 10-10-2004 12:47 AM
binding to YPserver takes a long time esteeven Linux - General 1 04-24-2004 02:46 AM
Gnome takes a long time to shutdown weelyjim Linux - Laptop and Netbook 1 02-05-2004 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration