Results 1 to 9 of 9

Thread: ubuntu desktop 18.04 networking dns server not added by NetworkManager

  1. #1
    Join Date
    Oct 2018
    Beans
    6

    ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Hello.

    I have had a ubuntu desktop 14.04 with manual network configuration. I recently upgraded it to 18.04.
    Upgrading to 18.04 has broken my DNS server configuration and I can temporary fix it by editing /etc/resolv.conf.
    However, I want to know how to do it CORRECTLY. Can someone help me find the way?

    First, I wanted to figure out where my manual network configuration is stored. (Yes, I have not used it for a long time.)
    I found nothing in /etc/network/interfaces. I have no files in /etc/netplan.
    Code:
    obelle:etc > cat /etc/network/interfaces
    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    obelle:etc > ls -a /etc/netplan
    ...
    I tried to grep my ip address in /etc and found NetworkManager is having my manual network configurations
    Code:
    obelle:etc > sudo grep -H "111.222.198.39" -r *
    NetworkManager/system-connections/Wired connection 1:address1=111.222.198.39/24,111.222.198.1
    obelle:etc > sudo cat "NetworkManager/system-connections/Wired connection 1"
    [connection]
    id=Wired connection 1
    uuid=0238a1e0-487a-48b6-9661-6bf71d8678fc
    type=ethernet
    permissions=
    timestamp=1539753475
    
    
    [ethernet]
    mac-address=00:3E:E1:C8:65:C1
    mac-address-blacklist=
    
    
    [ipv4]
    address1=111.222.198.39/24,111.222.198.1
    dns=111.222.16.61;111.222.16.62;
    dns-search=my.domain.com;
    method=manual
    
    
    [ipv6]
    addr-gen-mode=eui64
    dns-search=
    method=auto
    I edited IP prefix to 111.222 and search domain to my.domain.com for anonymity.
    Yes NetworkManager has both DNS servers but they are never added to /etc/resolv.conf.

    Code:
    obelle:etc > cat resolv.conf
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    # 127.0.0.53 is the systemd-resolved stub resolver.
    # run "systemd-resolve --status" to see details about the actual nameservers.
    
    
    nameserver 127.0.0.53
    obelle:etc > systemd-resolve --status
    Global
              DNSSEC NTA: 10.in-addr.arpa
                          16.172.in-addr.arpa
                          168.192.in-addr.arpa
                          17.172.in-addr.arpa
                          18.172.in-addr.arpa
                          19.172.in-addr.arpa
                          20.172.in-addr.arpa
                          21.172.in-addr.arpa
                          22.172.in-addr.arpa
                          23.172.in-addr.arpa
                          24.172.in-addr.arpa
                          25.172.in-addr.arpa
                          26.172.in-addr.arpa
                          27.172.in-addr.arpa
                          28.172.in-addr.arpa
                          29.172.in-addr.arpa
                          30.172.in-addr.arpa
                          31.172.in-addr.arpa
                          corp
                          d.f.ip6.arpa
                          home
                          internal
                          intranet
                          lan
                          local
                          private
                          test
    
    
    Link 3 (eth1)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
    
    
    Link 2 (eth0)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
    It appears NetworkManager's DNS server configuration does not apply. How can I fix this?
    Last edited by urmajest; October 18th, 2018 at 07:20 AM.

  2. #2
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    25,389
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    I have no files in /etc/netplan
    Is netplan installed?
    Code:
    sudo dpkg -s netplan.io | grep Status
    What does this report?
    Code:
    ls -al /etc/resolv.conf
    ps aux | grep systemd
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D., Sc.D.

  3. #3
    Join Date
    Oct 2018
    Beans
    6

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Thank you chili555,


    It appears netplan is installed.
    systemd-resolved appears to be running.

    Code:
    obelle:~ > sudo dpkg -s netplan.io | grep Status
    Status: install ok installed
    obelle:~ > ls -al /etc/resolv.conf
    lrwxrwxrwx 1 root root 29  1월 25  2016 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
    obelle:~ > ps aux | grep systemd
    root       330  0.0  0.1 134608 39336 ?        S<s  10월18   0:00 /lib/systemd/systemd-journald
    root       358  0.0  0.0  46944  5212 ?        Ss   10월18   0:00 /lib/systemd/systemd-udevd
    systemd+   690  0.0  0.0 146096  3280 ?        Ssl  10월18   0:11 /lib/systemd/systemd-timesyncd
    systemd+   698  0.0  0.0  70612  5160 ?        Ss   10월18   0:09 /lib/systemd/systemd-resolved
    root       873  0.0  0.0  70612  6100 ?        Ss   10월18   0:00 /lib/systemd/systemd-logind
    message+   878  6.4  0.0  51364  5644 ?        Ss   10월18  78:20 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
    gdm       1376  0.0  0.0  76860  8048 ?        Ss   10월18   0:00 /lib/systemd/systemd --user
    gdm       1414  0.0  0.0  50272  4616 ?        Ss   10월18   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
    hwanjo    4181  0.1  0.0  76760  7768 ?        Ss   11:16   0:00 /lib/systemd/systemd --user
    hwanjo    4307  0.0  0.0  16020  1092 pts/0    S+   11:16   0:00 grep --color=auto systemd
    Last edited by urmajest; October 19th, 2018 at 05:11 AM.

  4. #4
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    25,389
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Let’s try a few repairs. First, we’ll recreate the missing netplan file:

    Code:
    cd /etc/netplan
    sudo nano 01-network-manager-all.yaml
    Add the following. Spacing, indentation, etc. are crucial and must be perfect.

    Code:
    # Let NetworkManager manage all devices on this system
    network:
      version: 2
      renderer: NetworkManager
    Proofread carefully, save and close the text editor. Now do:

    Code:
    sudo netplan generate
    sudo netplan apply
    Next, I believe that your /etc/resolv.conf is faulty. In your case, resolv.conf is not pointing to systemd as expected. Therefore, please remove and recreate the link:

    Code:
    sudo rm -f /etc/resolv.conf
    ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
    Reboot and let us know if there is any improvement.
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D., Sc.D.

  5. #5
    Join Date
    Oct 2018
    Beans
    6

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Thank you chili555,

    I did what you have suggested step by step and reboot. (To be perfect, 'ln -s' required sudo)

    I have created the yaml file and let netplan generate and apply
    Code:
    obelle:~ > ls -l /etc/netplan
    total 4
    -rw-r--r-- 1 root root 104 10월 22 09:06 01-network-manager-all.yaml
    obelle:~ > cat /etc/netplan/01-network-manager-all.yaml 
    # Let NetworkManager manage all devices on this system
    network:
      version: 2
      renderer: NetworkManager


    /etc/resolv.conf is now pointing to systemd's. However, dns server is not set.
    Code:
    obelle:~ > ls -l /etc/resolv.conf
    lrwxrwxrwx 1 root root 37 10월 22 09:07 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
    obelle:~ > cat /etc/resolv.conf
    # This file is managed by man:systemd-resolved(8). Do not edit.
    #
    # This is a dynamic resolv.conf file for connecting local clients to the
    # internal DNS stub resolver of systemd-resolved. This file lists all
    # configured search domains.
    #
    # Run "systemd-resolve --status" to see details about the uplink DNS servers
    # currently in use.
    #
    # Third party programs must not access this file directly, but only through the
    # symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
    # replace this symlink by a static file or a different symlink.
    #
    # See man:systemd-resolved.service(8) for details about the supported modes of
    # operation for /etc/resolv.conf.
    
    
    nameserver 127.0.0.53
    obelle:~ > systemd-resolve --status
    Global
              DNSSEC NTA: 10.in-addr.arpa
                          16.172.in-addr.arpa
                          168.192.in-addr.arpa
                          17.172.in-addr.arpa
                          18.172.in-addr.arpa
                          19.172.in-addr.arpa
                          20.172.in-addr.arpa
                          21.172.in-addr.arpa
                          22.172.in-addr.arpa
                          23.172.in-addr.arpa
                          24.172.in-addr.arpa
                          25.172.in-addr.arpa
                          26.172.in-addr.arpa
                          27.172.in-addr.arpa
                          28.172.in-addr.arpa
                          29.172.in-addr.arpa
                          30.172.in-addr.arpa
                          31.172.in-addr.arpa
                          corp
                          d.f.ip6.arpa
                          home
                          internal
                          intranet
                          lan
                          local
                          private
                          test
    
    
    Link 3 (eth1)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
    
    
    Link 2 (eth0)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no


    Well, my ip configuration is correctly set (according to NetworkManager's configuration) after reboot.
    I believe there's no other subsystem that configures my IP address (as /etc/network/interfaces and /etc/netplan do not have my IP address setting)
    My IP address configuration and DNS settings are correctly set after reboot on NetworkManager app and /etc/NetworkManager/system-connections/Wired connection 1.
    It's strange that DNS server setting (and DNS search domain) is not applied somehow.


  6. #6
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    25,389
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    My IP address configuration and DNS settings are correctly set after reboot on NetworkManager app
    Automatic (DHCP) or have you specified any settings?

    May I see:
    Code:
    sudo NetworkManager --print-config
    I suspect the 'dns=' line is faulty.
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D., Sc.D.

  7. #7
    Join Date
    Oct 2018
    Beans
    6

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Thank you chili555,

    Quote Originally Posted by chili555 View Post
    Automatic (DHCP) or have you specified any settings?
    I have manual IP address and DNS server configuration. The following shows what NetworkManager GUI shows.

    (I modified my IP prefix to 111.222)

    Code:
    obelle:etc > sudo cat "NetworkManager/system-connections/Wired connection 1"
    [connection]
    id=Wired connection 1
    uuid=0238a1e0-487a-48b6-9661-6bf71d8678fc
    type=ethernet
    permissions=
    timestamp=1539753475
    
    
    [ethernet]
    mac-address=00:3E:E1:C8:65:C1
    mac-address-blacklist=
    
    
    [ipv4]
    address1=111.222.198.39/24,111.222.198.1
    dns=111.222.16.61;111.222.16.62;
    dns-search=my.domain.com;
    method=manual
    
    
    [ipv6]
    addr-gen-mode=eui64
    dns-search= method=auto
    
    Quote Originally Posted by chili555 View Post
    May I see:
    Code:
    sudo NetworkManager --print-config
    I suspect the 'dns=' line is faulty.
    Code:
    obelle:~ > sudo NetworkManager --print-config
    # NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity-ubuntu.conf, no-mac-addr-change.conf) (etc: 10-globally-managed-devices.conf, default-wifi-powersave-on.conf)
    
    
    [main]
    # rc-manager=symlink
    # auth-polkit=true
    # dhcp=dhclient
    dns=dnsmasq
    plugins=ifupdown,keyfile,ofono
    no-auto-default=00:3E:E1:C8:65:C1,
    
    
    [connectivity]
    uri=http://connectivity-check.ubuntu.com/
    
    
    [ifupdown]
    managed=false
    
    
    [logging]
    # backend=journal
    # audit=true
    
    
    [device-mac-addr-change-wifi]
    match-device=driver:rtl8723bs,driver:rtl8189es,driver:r8188eu,driver:8188eu,driver:eagle_sdio,driver:wl
    wifi.scan-rand-mac-address=no
    wifi.cloned-mac-address=preserve
    ethernet.cloned-mac-address=preserve
    
    
    [connection]
    wifi.powersave=3
    I don't know if networkmanager --print-config should have my manual IP address configuration and DNS server setting.

    Any suggestions?

  8. #8
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    25,389
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Let's have a look at:
    Code:
    sudo service systemd-resolved status
    Is it active?

    If not, try:
    Code:
    sudo systemctl enable systemd-resolved.service
    sudo service systemd-resolved start
    Check:
    Code:
    ping -c3 8.8.8.8
    ping -c3 www.ubuntu.com
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D., Sc.D.

  9. #9
    Join Date
    Oct 2018
    Beans
    6

    Re: ubuntu desktop 18.04 networking dns server not added by NetworkManager

    Thanks you chili555,

    Now I understand how things are working and solved the problem.

    So, the DNS server configuration (/etc/resolv.conf) is controlled by systemd-resolved at my system.
    I have configured my DNS server setting at NetworkManager.
    It appears that systemd-resolved overrides what NetworkManager configures.
    I have solved my problem by disabling systemd-resolved.

    Code:
    sudo service systemd-resolved stop
    sudo systemctl disable systemd-resolved
    sudo rm -f /etc/resolv.conf
    sudo service NetworkManager restart
    Many thanks to chili555 for your kind guidance!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •