I'm trying to figure out how to solve a specific problem related to the installation fo a framework that uses NetworkManager and dnsmasq (and configures them).
The background is like this. I have a cluster of multiple hosts, all running in a private network 192.168.150.0/24 with DHCP. They all have to be discoverable by name so one of the hosts acts like a dns nameserver. To get this to work I've made the configurations on all hosts (dns server + the rest- the clients) with specifying nameserver and the search domain in /etc/resolv.conf.
In order for the dns configuration file to not get overwritten by NetworkConfig I specified
Code: Select all
dns=none
However, I've run an automated installation that made some changes to my hosts, including intalling dnsmasq and configuring it (+ a lot of other insallation) and now I'm experiencing a weird behaviour, that, I think, is related to the NetworkManager service/configuration.
At this point, there is a script in /etc/NetworkManager/dispatcher.d/ that's creating/configuring some files in /etc/dnsmasq.d and enabling the dnsmasq service. The script reads the nameservers and the search domains that it finds in /etc/resolv.conf, creates the config files in /etc/dnsmasq.d based on them and then rewrites a new /etc/resolv.conf with a new configuration.
The problem I have is that at a service restart for NetworkManager, the script seems to run on predefined version of /etc/resolv.conf. In other words, no matter what I write in /etc/resolv.conf, after a systemctl restart NetworkManager, the end result (/etc/resolv.conf + config files in /etc/dnsmasq.d/) looks precisely the same.
My question is where is this "default" configuration written? How come does NetworkManager service "overlooks" the actual content of the /etc/resolv.conf file upon restart?
Further more, by running a
Code: Select all
nmcli con show "System eth0"
Code: Select all
...
IP4.ADDRESS[1]: 192.168.150.22/24
IP4.GATEWAY: 192.168.150.1
IP4.ROUTE[1]: dst = 169.254.169.254/32, nh = 192.168.150.1, mt = 100
IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 8.8.4.4
IP4.DOMAIN[1]: openstacklocal
...
The equivalent config file for this interface doesn't specify any of these:
Code: Select all
cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=fa:16:3e:9f:e5:f3
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
Dan