Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My computer slows down a lot when I open programs when my network connection is physically removed. When I reconnect my cable to my network card, the problem goes away. The problem only affects opening desktop programs with KDE or Gnome. Stuff like grep and ls in the terminal aren't affected at all.
I started using iptables lately, and I logged my output packets. I noticed that everytime I open a desktop program, three packets are being sent out. Two of them are on my loopback interface from 127.0.0.1 to the same address, and the third is sent to my DNS server on port 53 with UDP on my ethernet connection. I guessed that the reason my computer slows down opening programs without my ethernet connected is because the packet to the DNS server has to wait to timeout before it will let me open a program. My question is why is a packet getting sent out to my DNS server whenever I open a program, and how do I stop it?
Filtering out the packet with iptables doesn't do anything except make my computer slow even when my connection is still plugged in. Removing the nameserver from etc/hosts causes my browser not to be able to translate domain names, but the packet will still be sent out nevertheless. Completely stopping my network with /etc/rc.d/init.d/network stop will stop the packet to my DNS server and also the two packets from my loopback device from being sent, but of course stops any internet use at all.
I'm using Mandrake 8.1 on a 2.4.17 Kernel, and I use DHCP to get my IP and DNS address for my cable modem. Any help would be greatly appreciated.
Well it definetly looks like it tries to resolve the hostname when it starts a program. It needs to connect to the local x server and it's probably wants the hostname for that.
If you look in the file /etc/nsswitch.conf at the line for hostnames you'll see how the dns name gets resolved. I think in mandrake the default was something like:
files nisplus nis dns
That would mean for files it would look in /etc/hosts but it can't find the hostname there so it goes on to the next. Then it sends the two packets which you logged to find the nisplus and the nis servers but I doubt you have them installed so it just continues and goes on to your dns which is the udp packet on port 53. You use the dns server you got from your isp through dhcp. And that dns server knows nothing about your hostname so it will just timeout making you wait all that time.
So if you make sure your /etc/hosts contains the hostname it's trying to look for then it will find it right away.
How do I found how what program is trying to resolve this hostname? I've looked around XF86Config and I haven't seen anything obvious I should change. Whatever is trying to resolve this hostname is never getting it resolved, so it is probably ok to delete, I think, but how do I find out what it is? Or how do I find out what hostname is trying to be resolved so I put that in my hosts file?
Well it's most likely looking for either localhost or the hostname. You can find out what the hostname is by running hostname in a terminal. Make sure you have at least the following line in your /etc/hosts file:
127.0.0.1 localhost.localdomain localhost
You can add the hostname to the end of that line to let it resolve that one to.
If that doesn't help then you could use tcpdump or something like that to log the udp packets on port 53 going outwards. And try and see what kind of dns request it's trying to do.
Another thing to think about is this. By default X-Windows uses network connectivity to communicate across itself. It loads a set of core binaries to get up and running, and then uses network access to communicate with other programs(for things like KDE and GNOME this is probably 8-9 apps communicating). Most of the time it uses named pipes or the special X11 protocols to do this, but it's not uncommon for it to try vanilla tcp/ip to do so.
Whoo hoo! I finally found out what was happening. I got tcpdump and checked out the packet that was going to my DNS server and saw it was a query for my own hostname. The hostname I had was my own name, but I don't remember ever setting it to that. I did a search with grep -r though my /etc and the name never came up. Changing it with the hostname command would only change it for that logon too, which was a tad annoying. I found out how to change it from searching on the net, and then put a line in hosts to search at 127.0.0.1 for my new hostname, and there we go. No more extra packets searching for a resolution that will never come.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.