Stop Fedora from overwriting /etc/resolv.conf

20 Mar, 2011  |  Written by  |  under Uncategorized

I run my own local DNS server for DNS caching, and handling the local DHCP domains.

As my main firewall/router doesn’t move around (and thus doesn’t need to change it’s DNS), I prefer to hard code my /etc/resolv.conf file to add my local domains and DNS server. However, Fedora overwrites the /etc/resolv.conf file whenever the network boots.

Found an easy fix to this today. Add the following line to every ifcfg-* file in /etc/sysconfig/network-scripts


The PEERDNS line causes the dhclient script to not find the DNS server for that network link and add it to resolv.conf, so it leaves the file alone.

Here’s my resolv.conf:

search home
; Local machine's nameserver
; Telstra's nameservers in case mine is down

No Responses so far | Have Your Say!

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>