manually configure resolv.conf

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?

0
задан 12 September 2016 в 19:47
1 ответ

если ваш интерфейс настроен с использованием dhcp, вы должны использовать настройки клиента dhcp. Параметр, который вы, вероятно, захотите попробовать, - заменить серверы доменных имен 127.0.0.1, как показано здесь: https://unix.stackexchange.com/questions/136117/ignore-dns-from-dhcp-server-in- ubuntu , но я никогда не пробовал его в centos, поэтому не совсем уверен, какой файл вам нужно отредактировать

0
ответ дан 5 December 2019 в 09:33

Теги

Похожие вопросы