DNS settings get overwritten
Hi guys, Redhat guy trying to learn Debian here.
I've set up my interfaces ok and set them to static and I set up a bind server for DNS. But it seems like every so often resolv.conf gets overwritten with the DNS from DHCP. Network manager doesn't seem to be running and I can't understand why it keeps getting overwritten. Sure I could make it immutable using chattr (assuming that works ok in debian) but that's working round the issue. Any ideas why this is happening or what I can do to stop it? |
When a DHCP server gives you a DNS server address, shouldn't it be updated?
My resolv.conf has this comment: Quote:
Code:
man resolvconf |
Quote:
|
Ok, and there it goes. I'll have to now figure out how to change the DNS settings in virsh net-edit in KVM.
Tsss... This is really silly. When I tell my network interface to not use DHCP I don't see why it should still try and get DNS settings from DHCP. |
Sack it. I've just done a chattr +i on it.
Not very elegant, but it'll do the job. |
Well,.. if you are positive it isnt NetworkManager.. You can always use auditing to find out what is changing it:
Code:
# Set up the audit |
Quote:
What's the process name for networkmanager on debian just to make sure I'm not being a plonker. I can't see it in services and if I grep -i for net in ps i only get [netns] which I think is network namespace which... I honestly don't know enough about.. It might be the culprit. |
Hi,
Quote:
Code:
dpkg -L network-manager |grep bin Evo2. |
Thanks guys, next lab machine I build (which will probably be in the next couple of days), I'll user resolvconf on.
|
You have resolvconf* installed, which is trying to handle this for you "automagically". I would suggest removing it for a start. (*not to be confused with the resolv.conf configuration file).
I believe dhclient can still write to your resolv.conf regardless of if you setup a static address, but might be wrong about that. Editing the file and removing resolveconf should be enough. There are more eloquent solutions but if the chattr solution works... For DHCP, where you want to get an automatically assigned address, but specify your nameservers locally, edit dhclient.conf and add a suitable "prepend domain-name-servers" stanza. |
I liked your first suggestion (chattr -i)
|
All times are GMT -5. The time now is 10:07 AM. |