Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: dnsmasq, systemd-resolved etc

  1. #1
    Join Date
    Jul 2019
    Beans
    25

    dnsmasq, systemd-resolved etc

    I'm running 20.04 (up to date) on my laptop. Initial install was 19.04, and have upgraded at each release since then.

    While everything seems to be running fine, I've found some log errors from dnsmasq.

    systemctl status dnsmasq shows:

    Code:
     dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
         Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Sun 2020-07-05 10:01:42 AEST; 1h 37min ago
        Process: 1395 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
        Process: 1427 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
    
    Jul 05 10:01:41 dbUbuntu systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
    Jul 05 10:01:41 dbUbuntu dnsmasq[1395]: dnsmasq: syntax check OK.
    Jul 05 10:01:42 dbUbuntu dnsmasq[1427]: dnsmasq: failed to create listening socket for port 53: Address already in use
    Jul 05 10:01:42 dbUbuntu dnsmasq[1427]: failed to create listening socket for port 53: Address already in use
    Jul 05 10:01:42 dbUbuntu dnsmasq[1427]: FAILED to start up
    Jul 05 10:01:42 dbUbuntu systemd[1]: dnsmasq.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
    Jul 05 10:01:42 dbUbuntu systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
    Jul 05 10:01:42 dbUbuntu systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
    sudo netstat -ntlp | grep LISTEN shows that systemd-resolved is using port 53.

    But searching around, I found different information from various Ubuntu versions etc about whether dnsmasq is required or not - even some saying it was required by NetworkManager, mention of resolvconf etc.

    So, I'm confused about what the correct setup should be for 20.04? And to get to that correct setup, should I just disable the dnsmasq service?
    Last edited by apg6xswhjc; July 5th, 2020 at 03:15 AM.

  2. #2
    Join Date
    Jun 2016
    Beans
    2,026
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: dnsmasq, systemd-resolved etc

    Quote Originally Posted by apg6xswhjc View Post
    whether dnsmasq is required or not - even some saying it was required by NetworkManager,
    That is no longer true.

    what the correct setup should be for 20.04? And to get to that correct setup,
    The answer to this question is "whatever works for you".

    20.04 stock setup has NetworkManager using systemd-resolved . Do you have a specific reason to need something else for DNS?

  3. #3
    Join Date
    May 2007
    Beans
    205
    Distro
    Xubuntu

    Re: dnsmasq, systemd-resolved etc

    I ditched systemd-resolved a long time ago. It really slowed the DNS searches a lot and slowed down boot too.

    It is possible to disable systemd-resolved and go back to true and tested practices. How-to: https://gist.github.com/zoilomora/f7...b1fc2cea2c844c

    In fact systemd-resolved was the last straw that made me look for distros completely without systemd. And I've found PCLinuxOS and converted several machines to that. My main machine will be migrated from Ubuntu to PCLOS in time too.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  4. #4
    Join Date
    Jul 2019
    Beans
    25

    Re: dnsmasq, systemd-resolved etc

    Quote Originally Posted by halogen2 View Post
    20.04 stock setup has NetworkManager using systemd-resolved . Do you have a specific reason to need something else for DNS?
    Well, to be frank, I really don't know, as I may have installed something that requires it? I'd like to stick to stock as much as possible. I'm not interested in running a DNS server on this laptop, as it's just a client. It just gets it's DNS resolution from the router. /etc/resolv.conf I understood. All this stuff now??? Meh....

    When I do an apt-cache rdepends dnsmasq, it lists resolvconf and vpnc-scripts amongst others, and those rdepend to a bunch of stuff, including various VPN stuff. I do use the Network Manager OpenVPN. So I assume I can't just remove them.

    So, how can I prevent these errors?
    Last edited by apg6xswhjc; July 7th, 2020 at 12:35 PM.

  5. #5
    Join Date
    Jun 2016
    Beans
    2,026
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: dnsmasq, systemd-resolved etc

    Quote Originally Posted by apg6xswhjc View Post
    Well, to be frank, I really don't know, as I may have installed something that requires it?
    This should tell you what would happen if you removed it -
    Code:
    apt-get -s purge dnsmasq
    how can I prevent these errors?
    If you're OK with what you see with the above command, can you just purge that package for real? I use dnsmasq for DNS in 20.04, and I don't even have that service.

  6. #6
    Join Date
    Jul 2019
    Beans
    25

    Re: dnsmasq, systemd-resolved etc

    Code:
    $ apt-get -s purge dnsmasq
    NOTE: This is only a simulation!
          apt-get needs root privileges for real execution.
          Keep also in mind that locking is deactivated,
          so don't depend on the relevance to the real current situation!
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      dnsmasq*
    0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
    Purg dnsmasq [2.80-1.1ubuntu1]
    But:

    Code:
    $ sudo apt-cache rdepends dnsmasq
    [sudo] password for dburt: 
    dnsmasq
    Reverse Depends:
      dnsmasq-utils
     |x2gothinclient-management
      vpnc-scripts
      resolvconf
      netscript-2.4
      ltsp
      dnsmasq-base-lua
      dnsmasq-base-lua
     |di-netboot-assistant
      di-netboot-assistant
      dbab
      dnsmasq-base
      dnsmasq-base
    :S

  7. #7
    Join Date
    Jun 2016
    Beans
    2,026
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: dnsmasq, systemd-resolved etc

    That rdepends command isn't maximally helpful in these situations. Try these instead -
    Code:
    apt-mark showmanual | grep -F dnsmasq
    apt-cache rdepends --installed dnsmasq

  8. #8
    Join Date
    Jul 2019
    Beans
    25

    Re: dnsmasq, systemd-resolved etc

    Code:
    $apt-mark showmanual | grep -F dnsmasq
    dnsmasq

    Code:
    $apt-cache rdepends --installed dnsmasq
    dnsmasq
    Reverse Depends:
      dnsmasq-base
      dnsmasq-base

  9. #9
    Join Date
    Jun 2016
    Beans
    2,026
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: dnsmasq, systemd-resolved etc

    If you don't know why you have that package, it's safe to remove.

  10. #10
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,129
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: dnsmasq, systemd-resolved etc

    I'd learn to live with systemd-resolved. It's going to be with us for years to come. You don't need dnsmasq, nor will it work properly on a system running systemd-resolved since that service will claim the DNS port 53.

    You can specify static DNS servers by adding their IP addresses to the "DNS" and "FallbackDNS" lines in /etc/systemd/resolved.conf. Works like a charm here. You'll need to restart the service after making the changes with "sudo systemctl restart systemd-resolved".

    See "man resolved.conf" for more details.
    Last edited by SeijiSensei; July 8th, 2020 at 07:36 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Page 1 of 2 12 LastLast

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
  •