Last Updated: February 25, 2016
·
1.987K
· jandudulski

Adding entries to resolv.conf on Fedora

When developing application you would like to have local domain for an app like appname.dev or similar.

Finding solutions supported by dnsmasq is easy, but it was hard for me to find how to add localhost to resolv.conf without having overwritten file after each new connection.

You can chmod resolv.conf file as read only or disable overwriting in sysconfig, but that's not what I want. Finally, I found the solution:

  • open (or create) as sudo /etc/dhcp/dhclient.conf
  • just add: prepend domain-name-servers 127.0.0.1;

And... that's all! It is so easy that I cannot understand why it is so hard to google proper solution. But finally, if you found this tip, you got it :)

You can read more in man dhclient.conf