Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-23-2004, 04:59 AM   #1
LQ Newbie
Registered: Feb 2004
Posts: 12

Rep: Reputation: 0
Why does Linux do a DNS lookup everytime I start an application?

I notice that my box running Mandrake 9.2 does a DNS lookup for its own hostname (in this case "linux-box") every time it starts an X application. I'm talking about ANY application, not just those that need Internet access. This causes my box to take a LONG time to load any X app whenever my ISP's DNS server is slow, or whenever my cable connection goes down. This is really frustrating since it goes down often, and I'm left with an almost useless box (i.e. SLOW box). Is there any way I can bypass this? It's mind-boggling to me (a Linux newbie) why Mandrake has to rely on an outside server just to load an app. Please help me, anyone!
Old 02-23-2004, 05:17 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well i would assume that it is because it is connecting the X server, which is very much network aware, due to being client - server based. for a DNS lookup, it would first hit /etc/hosts, in order to resolve the hostname, failing that it then goes to the name servers in /etc/resolv.conf i would guess that you just bneed to add an entry to /etc/hosts so it will always instantly resolve the relevant hostname to itself. it is normal for the x applications to default to "localhost", i.e. loopback on, rather than the actual hostname itself, but that'd be the obviosu culprit.
Old 02-23-2004, 07:08 AM   #3
LQ Newbie
Registered: Feb 2004
Posts: 12

Original Poster
Rep: Reputation: 0
Wow, when I first read what you posted I thought to myself "well duh, you don't think I already tried that?" But I tried it anyway, and wow, that fixed it! Yaaayyy...thank you so much. I honestly remember playing with my hosts file and adding something that would make it recognize its own host name. I guess that was just in my dream then. Thank you once again, you prevented a newbie from reverting back to Windoze. Now I just wonder why Mandrake didn't do this by default when I set up the local host name.

I have another problem though: sometimes DNS resolves also take a long time from any browser. I know this isn't a problem with my ISP since when I do a DNS lookup from any of my Windows boxes at that same time, it works smoothly. I thought this was related to my first problem (apps starting up slow), but my adding my own host name to my hosts file didn't fix this one. What I've noticed is this happens once every hour or so, and it lasts for about 2-3 minutes, then everything goes back to normal again. When I try to access the Webmin server on my Linux box from another computer, it also loads up very slowly. But this doesn't seem to affect Samba accesses to my linux box. Weird huh? Do you have any idea what could be causing this? I know a bunch of people have posted this same question over the past few months, but none of the proposed solutions have worked (including turning off various services that seemed useless to me). Thanks in advance.

Oh yeah, sorry for the multiple postings.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Making some commands run everytime I start Linux (Slack 9.1) Agna Linux - Newbie 7 08-26-2005 09:38 PM
Traceroute, Ping, Domain Name Server (DNS) Lookup, WHOIS, and DNS Records Lookup netoknet General 1 05-09-2005 03:43 AM
windows 2000 client cannot lookup linux DNS reddy Linux - Networking 2 05-14-2004 06:27 AM
Why does Mandrake do a DNS lookup everytime I start an application? Bandhel Mandriva 1 02-23-2004 05:17 AM
DNS getting queried everytime I open a program Zil Linux - Networking 5 03-14-2002 02:47 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:26 PM.

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