LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   dns-nameserver setting ignored (https://www.linuxquestions.org/questions/debian-26/dns-nameserver-setting-ignored-4175671818/)

berndbausch 03-23-2020 04:23 AM

dns-nameserver setting ignored
 
I am trying to convince Debian Buster to use the nameserver defined in /etc/network/interfaces, as follows:
Code:

auto ens3f0
iface ens3f0 inet static
        address 192.168.1.251
        netmask 255.255.255.0
        gateway 192.168.1.1
        dns-nameservers 192.168.1.249

I clear /etc/resolv.conf, then systemctl restart networking. /etc/resolv.conf remains empty. I tried ifdown ens3f0; ifup ens3f0, same result. I removed the "s" from dns-nameservers, same result. In my desparation I replace the dns-nameserver line with "dns-blabla" and didn't get an error message.

By the way, this server runs NetworkManager, but I understand that NM leaves NICs alone when they have an entry in /etc/network/interfaces. Indeed, nmcli d shows ens3f0 is unmanaged. In any case, I also stopped NetworkManager. No change. Reboot - same result.

Yes I know I can just write the nameserver in /etc/resolv.conf manually. But I want it to work the way it's documented.

What is going on? Where do I look?

ondoho 03-23-2020 04:35 AM

Is systemd-networkd supposed to honor the settings in /etc/network/interfaces?
Is it active at all?
On my laptop - which uses NetworkManager - it isn't:
Code:

$ systemctl | grep -i network
...
$ resolvectl

In that case it would be solely a case for network-manager (honoring these settings or not).
Maybe it has its own config option to globally define nameservers?

berndbausch 03-23-2020 05:42 AM

Quote:

Originally Posted by ondoho (Post 6103356)
Is systemd-networkd supposed to honor the settings in /etc/network/interfaces?
Is it active at all?
On my laptop - which uses NetworkManager - it isn't:
Code:

$ systemctl | grep -i network
...
$ resolvectl

In that case it would be solely a case for network-manager (honoring these settings or not).
Maybe it has its own config option to globally define nameservers?

Neither systemd-resolved nor systemd-networkd are active. I don't think you need either for processing /etc/network/interfaces. Proof: All other settings (IP address, netmask, gateway) are honoured.

The problem occurs when NetworkManager is active/enabled and dead/disabled.

Luckily I still have some hair to pull out.

Code:

# resolvectl
Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.
# systemctl status systemd-networkd
● systemd-networkd.service - Network Service
  Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; ve
  Active: inactive (dead)
    Docs: man:systemd-networkd.service(8)


berndbausch 03-23-2020 07:17 AM

Well, I do need resolvconf if I want dns-nameservers to have the intended effect. It was not installed.


All times are GMT -5. The time now is 12:10 AM.