Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
So I recently installed madwifi to work as a driver for my wireless card on Linux. For awhile, this was working fine, as long as I opened a root shell on startup and entered:
ifconfig ath0 up (bringing the ath0 interface online??)
iwconfig ath0 ap any (configuring ath0 to pick the nearest access point???)
dhclient (bringing up a dhcp client, which should configure IP and DNS addresses???)
However, after awhile, I was noticing that when I worked on a non-work network, I would have about 1 minute of happy internet access, but then firefox would hang (seemingly forever) in "looking up URL".
This would appear to be a DNS problem, but what does one do about it? I learned (out of necessity) that killing and restarting dhclient would get me another minute of access (helpful because I get my info from google!). I also learned that the contents of resolv.conf should include the IP addresses of the nameservers. OK, so here was the contents of resolv.conf:
; generated by /sbin/dhclient-script
OK - so it makes sense that DNS should have a problem - the IP addresses were DNS servers on the network at work, but wouldn't be accessible from my cable modem router at home. So... in the 1 minute where DNS was working, I used nslookup to determine the IP address of the DNS server that worked at home:
(the address of the router - acting as a nameserver? forwarding DNS requests to someone upstream?)
OK - so this is fine - I just need to add it to the resolv.conf file, right?
I also find out on this forum that the "search" line can cause problems, so I commented it out for now. (What does the "search" line do? is it evaluated before the "nameserver" lines? wouldn't a search be slower than looking up a known server?)
So - I added it to the end of the list, like this:
And... lo and behold, ping, nslookup and firefox begin to work - but response is slow (but nearly constant delay). So - I guess that the delay is waiting for timeout from the two inaccessible servers listed earlier in the file, so I change the order:
#1 - why does running dhclient make DNS work for a short period of time, but then futz out afterwards? I assume that it caches the newly discovered DNS name somewhere, but then renews that information from resolv.conf periodically. Why didn't dhclient add the new DNS address to resolv.conf?
#2 - if I move this new resolv.conf file back to work, won't I have to wait for 192.168.10.1 to timeout (not on the work network) before accessing the work DNS servers? Can I somehow configure DNS to look for the right set of servers straight away based on which network I'm connected to?
This is a strange problem, as /etc/resolv.conf should get it's servers from the DHCP client. It shouldn't hold servers from a previous DHCP session like that. The only time I am aware that it would do that is if the the computer failed to get a DHCP lease on the new network. In that case it would still use the servers from the last lease, but clearly that is not the case since you get an IP and are able to connect for awhile.
Unless I am not thinking of something, this sounds like it might be a distro-specific issue. You didn't say (or at least I missed it) what distribution you were running, perhaps that would help.