/etc/resolvconf/d/head File to be prepended to the dynamically generated resolver configuration file. /etc/resolvconf/d/tail File to be appended to the dynamically generated resolver configuration file. This file is a good place to put a resolver options line if one is needed, e.g., options inet6 which means that if the name searched for is not in the cache, then it is asked for at 8.8.8.8 and not at the server provided by dhcp.

updating resolv conf-74updating resolv conf-19

They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Click Here to receive this Complete Guide absolutely free.

I do not want network-manager to add DNS servers received from DHCP to my /etc/

Network Manager will update to reflect the nameservers provided by currently active connections.

For convenience sake, I am posting this in my github repo as well. This is the main working "script", which does the magic happen: - name: Check if there are any previous entries in find: paths: /etc/patterns: '^nameserver ([0-9]\.)[0-9]$' register: found_previous - name: Set up (non-verride).

template: src: "" dest: /etc/owner: root group: root mode: 0644 with_first_found: - files: - "" - resolv.j2 paths: - ../templates when: (found_previous is not defined and replace_previous == 1) or replace_previous == 0 - name: Set up (override or non-existent).The second commented line is the nameserver that was used when I originally installed the machine. It appears to be deleting the entry in when it "shuts down" the Zimbra DNSCache module (which I'm not using).I've searched all through /etc and 97.65yyyy appears nowhere in /etc that I can find. But it has also deleted 127.0.0.1 as well (turning on Network Manager seems to keep it from deleting 127.0.0.1) and I'm trying to troubleshoot an issue and want to make sure there are no networking issues in here. I'm not sure this will be of much use to many people but I will post the final update once I have all the relevant info on a fix.In fact, nm-tool says My issue was a bit different, I wanted to override my routers DNS servers.I found this link from Ubuntu: https://wiki.ubuntu.com/Override DNSServers It says: If you would like to override the DNS settings provided to you by a DHCP server, open but this is not recommended in certain case, a better solution is to setup correctly all the program/services using the DNS like (dnsmasq/network-manager/resolvconf/etc.) Here is an exhaustive list of setups to get back the control of and avoid having it overwritten (how to disable/setup DNS from other location other than resolv.conf) note that resolvconf is an independent program from resolv.conf, also depending on your system/config you may not have one or many of the programs listed here. auto local iface lo inet loopback # The primary network interface #iface eth0 inet dhcp iface eth0 inet static address x.x.x.x netmask 255.255.255.0 gateway x.x.x.x #nameservers # you may not need dns-search # I use it because I'm running this on a Windows network # so its useful to have # dns-search x.y dns-nameservers 4.4.4.4 8.8.8.8 directory.I am posting this simple role in order to demonstrate some of the capabilities of Ansible.