• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

/etc/resolv.conf

xtknight

Elite Member
My Comcast DNS servers were down, so I wanted to add a universal DNS (4.2.2.1) to /etc/resolv.conf. I commented out:

#search localdomain
#nameserver 172.16.143.2

And added:

nameserver 4.2.2.1

Yet, every 20 minutes or so, the whole file is deleted and replaced with

search localdomain
nameserver 172.16.143.2

again, and my DNS ceases to work. What gives?
 
Originally posted by: xtknight
Hmm...yes I am using DHCP. Can I use DHCP for my IP address but not for my DNS servers?

Yep. I couldn't tell you how though. It depends on your dhcp client, and I've never read the docs for any but dhclient, and those I didn't read well because I didn't care. 😛
 
I'm using dhclient. 😉

Turns out I just had to add this to /etc/dhcp3/dhclient.conf. Then rerun dhclient.

prepend domain-name-servers 4.2.2.1;

Thanks for the clue it was DHCP.
 
Originally posted by: xtknight
I'm using dhclient. 😉

Turns out I just had to add this to /etc/dhcp3/dhclient.conf. Then rerun dhclient.

prepend domain-name-servers 4.2.2.1;

Thanks for the clue it was DHCP.

That's a pretty simple fix. :beer:
 
I spoke a little too soon. It did it again, but then when I ran dhclient, it added the 4.2.2.1 DNS back. Very odd.
 
I did:
sudo /etc/init.d/networking restart

And now even my Comcast DNS servers seem to be working. Prior to this problem my network had for some reason just broken itself, so maybe the networking daemon took a dump.
 
There's no singular 'networking daemon' and I wouldn't trust the networking init script to restart the DHCP client, I would have done 'ifdown ethX', made sure that dhclient was killed and then ran 'ifup ethX'.
 
Never mind. I had figured out that after restarting the networking init.d service my regular DNS were working again. My cable modem was having issues this morning (it took 10 mins to start), so I'm going to attribute the problem to that. Plus, dhclient was grabbing an IP for my vmware instead of my eth0 unless I specified otherwise, so maybe that was it. It has been fine all today (since a cable modem, router, system restart).

pkill? Is that different than kill?

Edit: Actually now the thing is working like it's supposed to (the system reboot restarted something that now has the new config in memory?) 4.2.2.1 has been added to resolv.conf after the 'search' line. Maybe that is why my DNS is fine now. Whatever, I'm going to leave it like this for a week or so and then change back to Comcast's DNS.
 
Originally posted by: xtknight
Never mind. I had figured out that after restarting the networking init.d service my regular DNS were working again. My cable modem was having issues this morning (it took 10 mins to start), so I'm going to attribute the problem to that. Plus, dhclient was grabbing an IP for my vmware instead of my eth0 unless I specified otherwise, so maybe that was it. It has been fine all today (since a cable modem, router, system restart).

pkill? Is that different than kill?

Yes. kill requires the pid number, pkill doesn't.
 
Back
Top