Skip to content

Instantly share code, notes, and snippets.

@cpburnz
Last active January 29, 2019 17:38
Show Gist options
  • Save cpburnz/9cb79ee3477c997d76958cffc7fab1de to your computer and use it in GitHub Desktop.
Save cpburnz/9cb79ee3477c997d76958cffc7fab1de to your computer and use it in GitHub Desktop.
Ubuntu 18.04 Networking

Fix systemd's broken DNS resolution

Systemd by default breaks DNS name resolution by overriding /etc/resolv.conf to use its useless stub DNS server, and not the network managed one.

Symlink /run/systemd/resolve/resolv.conf to /etc/resolv.conf:

sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Sources:

Setup Windows NetBIOS name resolution

  1. Install libnss-winbind:

     sudo apt-get install libnss-winbind
    
  2. Enable NetBIOS name resolition by editing /etc/nsswitch.conf and changing the following line

     hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
    

    and adding "wins" to the list after "dns":

     hosts:          files mdns4_minimal [NOTFOUND=return] dns wins mdns4
    

    If you don't care about mDNS resolution (automatic network host name resolution for *.local similar to NetBIOS), then "mdns4_minimal [NOTFOUND=return]" and "mdns4" can be removed:

     hosts:          files dns wins
    

Source: How to enable Linux machines to resolve Windows hostnames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment