Skip to Content
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Sign in
  • Nederlands English (US) Español (AR)
  • Contact Us
  • Home
  • Blog
  • Jobs
  • Contact us
Cafayate.Net
  • 0
  • 0
    • Home
    • Blog
    • Jobs
    • Contact us
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Sign in
  • Contact Us

ubuntu 16.10 dnsmasq troubleshoot

  • All Blogs
  • Tech Blog
  • ubuntu 16.10 dnsmasq troubleshoot
  • March 5, 2021 by
    Administrator

    Ok, so here’s what I’ve learned. Ubuntu uses systemd-resolved now for DNS stuff. However, if you want the DNS server from DHCP negotiation to be passed along to this service, you also need to use systemd-networkd to configure your interfaces. This means no NetworkManager, no resolvconf, no dnsmasq. Link Link Link

    Ok, so let’s switch to systemd-networkd:

    sudo systemctl enable systemd-networkd
    sudo systemctl disable NetworkManager
    sudo systemctl stop NetworkManager
    sudo systemctl start systemd-networkd

    I also need to create /etc/systemd/network/wired.network so that systemd-networkd knows what to do:

    [Match]
    Name=eth*
    [Network]
    DHCP=yes

    Finally, we need to set up this softlink so that systemd-resolved controls which DNS servers are used:

    sudo rm /etc/resolv.conf
    sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

    Ok, so. For whatever reason, systemd-resolved doesn’t properly resolve unqualified domains. I thought it might be because it was trying to do DNSSEC verification (which my router’s DNS server doesn’t support), but even when I allowed fallback, it still didn’t work. No idea what’s going on, but I have to assume it’s a bug in systemd-resolved.

    Having said that, I can still use systemd-networkd and systemd-resolved to control /etc/resolv.conf (i.e. have it point to my router’s DNS server). I just want things to skip trying to use systemd-resolved, so that means removing resolve from /etc/nsswitch.conf, so everything always falls back to DNS, which properly resolves my unqualified domains names:

    Before:

    hosts: files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns

    After:

    hosts: files mdns4_minimal [NOTFOUND=return] dns

    When nsswitch falls back to DNS, it properly resolves bruce. to its IP on my router’s subnet, not 127.0.0.1, so that’s good enough to fix this problem.

    Another alternative might be to have my router’s DNS server put all the names in a LAN domain, and configure systemd-resolved to try to append that domain…but I’m fed up.

    in Tech Blog
    How to remove docker from Ubuntu 16.04

    Designed for companies

    We are a team of passionate people whose goal is to improve everyone's life through disruptive products. We build great products to solve your business problems. Our products are designed for small to medium size companies willing to optimize their performance.

    Get in touch

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Follow us
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)