0

I need to have my own DNS server in the corporate.
I have the following config set for netplan:

network:
    version: 2
    renderer: NetworkManager
    ethernets:
        eno1:
            dhcp4: yes
            addresses:
              - 192.168.1.240/24
            nameservers:
              addresses: [192.168.1.10]

At first I have the following on running resolvectl status after running sudo netplan apply:

Link 2 (eno1)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.10
       DNS Servers: 192.168.1.10 192.168.254.112 192.168.254.113 192.168.254.114

But after a while I get the following:

Link 2 (eno1)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.254.112
       DNS Servers: 192.168.1.10 192.168.254.112 192.168.254.113 192.168.254.114

What's wrong here?
How can I fix using my own DNS using netplan. And the DNS server is since it is on my local network.

6
  • Your netplan file refers to Network Manager. Is NM running here? If so, revert netplan to its default and make your DNS and static IP address changes in the NM settings.
    – chili555
    Aug 13, 2022 at 13:43
  • Yes NM is there. And yes, changes get applied. Aug 14, 2022 at 6:42
  • I shall propose an answer that I hope you will accept: askubuntu.com/tour
    – chili555
    Aug 14, 2022 at 15:26
  • It looks like you are being sent DNS server settings over DHCP, which by default are merged with those you specify manually. If you don't want to use these, you can override with dhcp-options; see the netplan manpage for details.
    – slangasek
    Aug 14, 2022 at 16:58
  • Seems like use-dns is not working on NetworkManager backend. @slangasek Aug 16, 2022 at 5:16

1 Answer 1

0

Your netplan file refers to Network Manager. I suggest that you revert netplan to its default:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Next, set your static IP address and DNS in the Network Manager settings:

enter image description here

Reboot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .