LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices

Reply
 
Search this Thread
Old 11-08-2006, 09:07 AM   #1
question_box
LQ Newbie
 
Registered: Nov 2006
Posts: 2

Rep: Reputation: 0
DNS issues with wireless?


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
search work.domain
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

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:

192.168.10.1

(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:

; generated by /sbin/dhclient-script
#search work.domain
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
nameserver 192.168.10.1

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:

; generated by /sbin/dhclient-script
#search work.domain
nameserver 192.168.10.1
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

Lo and behold - lightning quick, reliable access!

But, I'm left with some questions:

#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?

Confused...
 
Old 11-08-2006, 10:38 AM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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.

Last edited by MS3FGX; 11-08-2006 at 10:40 AM.
 
Old 11-08-2006, 11:38 AM   #3
question_box
LQ Newbie
 
Registered: Nov 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Distro is FC4

with standard install from ISO images.

Thanks for any insight you can provide!
 
  


Reply


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
DNS issues DigiCrime Linux - Software 0 11-06-2005 02:05 PM
DNS issues juanb Linux - Networking 1 09-14-2005 07:46 AM
Wireless DNS issues tnine9 Linux - Wireless Networking 6 02-01-2005 09:31 AM
DNS Issues ... c2lancas Linux - Networking 10 11-08-2004 01:19 PM
lame dns servers etc and general dns issues suse_linux9.1 Linux - Networking 3 06-01-2004 01:50 PM


All times are GMT -5. The time now is 10:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration