I am trying to setup dnsmasq on my machine, however I am having an issue with setting the order or nameservers correctly.
My interface is assigned DNS servers via NetworkManager and DHCP, and those will, seemingly, take priority no matter what I do; I need to completely ignore the nameserver I am sent via DHCP and use localhost only.
I have tried modifying /etc/sysconfig/network-scripts/ifcfg-*
, adding DNS1=127.0.0.1
, however I am then presented with the fowwloing warning message on restart of NetworkManager
dnsmasq[24391]: ignoring nameserver 127.0.0.1 - local interface
I have also tried different configurations with
/etc/NetworkManager/NetworkManager.conf
dns=dnsmasq # both on and off
All with no avail.
I am running CentOS7, and my question is this:
What do I need to configure to ensure that my system always uses 127.0.0.1 as the default, and only nameserver?
если ваш интерфейс настроен с использованием dhcp, вы должны использовать настройки клиента dhcp. Параметр, который вы, вероятно, захотите попробовать, - заменить серверы доменных имен 127.0.0.1, как показано здесь: https://unix.stackexchange.com/questions/136117/ignore-dns-from-dhcp-server-in- ubuntu , но я никогда не пробовал его в centos, поэтому не совсем уверен, какой файл вам нужно отредактировать