LinuxQuestions.org
Review your favorite Linux distribution.
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 07-03-2006, 08:56 PM   #1
johngrinham
Member
 
Registered: Dec 2003
Location: Toowoomba, Australia
Distribution: Mostly Debian
Posts: 45

Rep: Reputation: 15
resolv.conf won't hold dns


I'm pretty sure my problem is with DNS.
If I edit the resolv.conf with my DNS from the ISP, every thing seems to work fine. But a reboot wipes the resolv.conf and replaces the DNS with my gateway.

/etc/network/interfaces has been edited with
auto eth0
iface eth0 inet static
address 192.168.1.40
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
name Ethernet LAN card
dns-nameservers 203.8.183.1 192.189.54.33

/etc/hosts is
127.0.0.1 Knoppix localhost localhost.localdomain
192.168.1.40 knoppix.studio knoppix

/etc/resolv.conf should be
search aapt.net.au
nameserver 208.8.183.1
nameserver 192.189.54.33

but after reboot is
search aapt.net.au
nameserver 192.168.1.1

resolv.conf is the only file that changes, does anyone know what is changing it.?
 
Old 07-03-2006, 11:23 PM   #2
tgo
Member
 
Registered: Dec 2004
Posts: 125

Rep: Reputation: 15
On debian the file is located at /etc/dhclient-script and the function

Code:
make_resolv_conf() {
is the culprit. What I did was change the code in it to something like

echo "skipping..."

There is two calls to this funtion right next to each other that you need to change in the file.

Another thing... if you have static values that you want why are you using dhcp anyway? ( You dont specifically mention dhcp, but from what you said about it being wiped on reboot i think its a safe bet ).

Last edited by tgo; 07-03-2006 at 11:25 PM.
 
Old 07-04-2006, 02:50 AM   #3
johngrinham
Member
 
Registered: Dec 2003
Location: Toowoomba, Australia
Distribution: Mostly Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tgo
Another thing... if you have static values that you want why are you using dhcp anyway? ( You dont specifically mention dhcp, but from what you said about it being wiped on reboot i think its a safe bet ).
Sorry, should have said, on a good day there are about 8 devices on this network. Not all are computers, (playing with voip(asterisk)). So the router still needs to hand out IP settings to 2 voip devices, and 3 win_XP devices,(family and work).
My linux boxes are the problem, I have a triple boot(knoppix, StudioToGo and Agnula Demudi, (all Debian based)). With these set for dhcp, some browsing works, typically Konqueror, but firefox tends to fail. Also apt-get doesn't work, the address it tries to use is 1.0.0.0, which suggests a dns problem. So I tried setting it up manually and that appears to work OK, but after a reboot it loses the dns again. Hope I haven't bored you yet.

Anyway, thanks for your guidance, I'll look at it later tonight.
 
Old 07-04-2006, 08:08 AM   #4
johngrinham
Member
 
Registered: Dec 2003
Location: Toowoomba, Australia
Distribution: Mostly Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tgo
On debian the file is located at /etc/dhclient-script.
Searched everywhere, all through /etc, and any sub-directory with dh in it.
/etc/dhclient-script doesn't exist, nor does
/etc/dhcp3/dhclient.conf (I saw a reference to this in this forum)

Is there anywhere else it might be.?
 
Old 07-04-2006, 08:54 AM   #5
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 30
Quote:
Originally Posted by tgo
Another thing... if you have static values that you want why are you using dhcp anyway? ( You dont specifically mention dhcp, but from what you said about it being wiped on reboot i think its a safe bet ).
tgo is correct. DHCP clients will wipe out /etc/resolv.conf (and ntp.conf if you have one) whenever they are started/re-started.

I've just loaded up Debian to play with so I can't help too much at this point, but
Code:
/etc/dhclient-script
/etc/dhclient.conf
are both in /etc on my box. For what it's worth.
 
Old 07-04-2006, 11:35 AM   #6
tgo
Member
 
Registered: Dec 2004
Posts: 125

Rep: Reputation: 15
Quote:
Originally Posted by johngrinham
Searched everywhere, all through /etc, and any sub-directory with dh in it.
/etc/dhclient-script doesn't exist, nor does
/etc/dhcp3/dhclient.conf (I saw a reference to this in this forum)

Is there anywhere else it might be.?
well you just need to find your dhcp client script. Try

locate dhcp
locate dhclient

also try ps aux | grep dh

and see if anything this running b/c if you run dhcp at boot the client should still be running the whole time.
Maybe check the boot logs and see where the dhcp is being set. In my syslog I have this on each boot:

Code:
Apr 19 01:00:16 localhost dhclient: DHCPREQUEST on eth0 to 192.168.1.1 port 67
Apr 19 01:00:16 localhost dhclient: DHCPACK from 192.168.1.1
Apr 19 01:00:16 localhost dhclient: bound to 192.168.1.108 -- renewal in 43200 seconds.
which should give you a hint as to whats controlling it.
 
Old 07-05-2006, 12:44 AM   #7
johngrinham
Member
 
Registered: Dec 2003
Location: Toowoomba, Australia
Distribution: Mostly Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Wow, new toys...!

Ok. located dhclient-script in /etc/rootstrap, but it didn't contain anything regards resolv.conf
Can't locate dhclient.conf, doesn't exist.

ps aux | grep dh, produced no visible outcome(I'm not sure what was supposed to happen)

I used dmesg, but nothing there gave me any clues.

I think Knoppix is the wrong distro to be using in my network, obviously it was engineered for single users who aren't expected to want to do the things I'm trying to do. So I'm gonna scrap it and install Debian 3.1

Thanks for the info tho, it may still be required.
 
Old 07-05-2006, 01:45 AM   #8
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
Just a couple quick comments:

(1) I think you're likely to do better with Etch (netinstal) than Sarge. Knoppix would include all the latest stuff, and if it's working pretty good, Etch is a closer match.

(2) Are you using DSL for internet? Such connection problems with which I am personally familiar seem to be more common with DSL than Cable.

I'll watch the thread, because I'm intersted in seeing a definitive solution.
 
Old 07-05-2006, 08:09 AM   #9
johngrinham
Member
 
Registered: Dec 2003
Location: Toowoomba, Australia
Distribution: Mostly Debian
Posts: 45

Original Poster
Rep: Reputation: 15
I'm not finished re-installing yet, but I've already come to the conclusion that I've lead everyone (including myself) down the garden path.
My ongoing problem has only ever been with the linux boxes, 3 XP boxes have been working perfectly (well, as perfectly as windows can :-), so my my line of thought was 'Why is linux losing the dns'. My first attempt at installing Debian came to a crashing halt at the point where it auto assigned dhcp during install and tried to download security data. Couldn't do it for the usual reason, couldn't translate the address to anything but 1.0.0.0.
But.!!!
I never had this problem at the original install. So what is different.?
My adsl modem/router died and I replaced it. At the time I was more interested in getting the family XP boxes running and probably didn't use the linux box for a few days. So when I did, I didn't associate the fault with the adsl router as the XP boxes were working.
Apparently, windows does some abnormal things to get dns totally unreliant on the router settings. After 3 or 4 changes to the dns settings in the router, I can now get the security updates, which hopefully means I don't have to change dhcp to static. (ps unfortunately the install fails trying to install packages so I might try Ubuntu instead)

Sorry for the run around, and thanks for the guidance. I'll post again when I'm fully installed
 
Old 07-05-2006, 10:39 AM   #10
johngrinham
Member
 
Registered: Dec 2003
Location: Toowoomba, Australia
Distribution: Mostly Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Woohoo.
Everything seems to be working. It took a failed attempt at a new install to correctly diagnose where the problem was, but thats life.
Knoppix was probably OK, but lets give ubuntu a go for a while.
 
  


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
Fedora DNS resolv.conf issue waelaltaqi Linux - Networking 16 07-05-2006 03:23 AM
DNS Hosts.conf or resolv.conf problem mac_casey Suse/Novell 0 03-26-2006 09:21 AM
resolv.conf dns issues billbob Linux - Software 3 09-30-2005 12:20 PM
dns server and /etc/resolv.conf freeosfreesoul Linux - Laptop and Netbook 2 09-02-2005 06:45 PM
DNS & resolv.conf robeb Linux - Networking 1 06-25-2002 09:15 PM


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

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