Dnsmasq not starting - Ubuntu 18.04

resolved

#1

I just found this thread. I have same issue.
I want to know that once the problem is fixed that it will be updated in this thread.


Dnsmasq fails on Pi-hole 3.3
#2

Hello
I am relatively new to pi-hole. But hooked now.
I run it on my ubuntu server (not the actual raspberry pi). I had it working on 17.10. I had to re-start the dnsmasq everytime I rebooted the machine. But that’s past.
I had to re-install the os. So, I installed 18.04 64 bit.
And now, once I install the pi-hole, it doesn’t block anything (if I don’t reboot my machine). Soon as I reboot, there is no internet. And the dnsmasq isn’t running. The only way to get internet working is to change the nameserver in /etc/resovle.conf to opendns or google or something other than local host.
Now, I found this thread and tried to use the older version but that doesn’t work and has same symptoms.
So I generated the debug token : “9h5jyaddvg” .

Any help is much appreciated.

9h5jyaddvg


#3

Can you try a pihole -r > Repair?


#4

Yes. I did repair. Didn’t work.
I uninstalled it (from uninstall script). And then got 3.2.1 version and did fresh install. Same results. I ran repair and reconfigure again as well. No change.

Edit:
I should have noted that: the pihole works but the console doesn’t (need to reboot after install). I don’t really need console right away, I can wait for next version . But the host (where it’s installed) can’t access internet.
And I use that computer as multipurpose server, so it needs internet.


#5

Make a new debug token.


#6

I was out of town for a few days.
new token : “i29a2cj88i”
Also, few things to note:
I had to re-install pi- hole, I installed latest. Now it blocks some ads but most show up.
I do nslookup for 888.com and it returns local host. But also shows “non authoritative” to be real ip of the site.
In the past most of the ads from my android phone apps were blocked and now they show up. (My regular browsers if I diable my ad block add ons, the ads show up)
Thank you for your help.


#7

So, I have been looking around and found these two threads. I think they are very relevant to my issue. But a dev/ expert can confirm.


I tried following steps outlined by rrobgill but didn’t work for me. Let me know if I should upload run a new token:
If you could please try the following steps:

Restore /etc/resolve.conf to its initial default state - contains:
nameserver 127.0.0.1

Check that /etc/systemd/resolved.conf contains
DNSStubHandler=no

Force a reload of all of systemd-resolved's configuration files
sudo systemctl reload-or-restart systemd-resolved

Repair Pi-hole (to ensure dnsmasq's config files are correct)
pihole -r

Then, if you could please report the output of
systemctl status dnsmasq.service systemd-resolved

Should they not both be running:

if you could please try:
sudo systemctl daemon-reload

then once again
pihole -r

and once again, please report the output of
systemctl status dnsmasq.service systemd-resolved

"


#8

Yes, upload a new debug token and also share the output of sudo service dnsmasq status -l


#9

New token :hvh6nl9hob
couple of notes:
dnsmasq doesn’t autostart nor can I launch manually.
To get internet working on the pi hole computer, I re-start network manager by running “sudo service network-manager restart”
And the token was generated after I re-started network-manager.
dnsmasq status

dell@dell:~$ sudo service dnsmasq status -l
● 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 Mon 2018-05-21 12:15:39 EDT; 3h 44min ago
Process: 1047 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 1031 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

May 21 12:15:38 dell systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server…
May 21 12:15:39 dell dnsmasq[1031]: dnsmasq: syntax check OK.
May 21 12:15:39 dell dnsmasq[1047]: dnsmasq: failed to create listening socket for port 53: Address already in use
May 21 12:15:39 dell dnsmasq[1047]: failed to create listening socket for port 53: Address already in use
May 21 12:15:39 dell systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
May 21 12:15:39 dell dnsmasq[1047]: FAILED to start up
May 21 12:15:39 dell systemd[1]: dnsmasq.service: Failed with result ‘exit-code’.
May 21 12:15:39 dell systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
dell@dell:~$


#10

what’s the output of sudo lsof -i :53 +c 15 ?


#11

dell@dell:~$ sudo lsof -i :53 +c 15
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd-resolve 793 systemd-resolve 12u IPv4 20489 0t0 UDP localhost:domain
systemd-resolve 793 systemd-resolve 13u IPv4 20490 0t0 TCP localhost:domain (LISTEN)
dell@dell:~$

Also, something weird: I assigned static ip in router (not in computer). And I used 180. However, I see 222 attached to the computer as well!


#12

this pull request will address the systemd-resolve issue:

Meanwhile, edit /etc/systemd/resolved.conf and change DNSStubListener=yes to DNSStubListener=no then
sudo systemctl reload-or-restart systemd-resolved
and then
sudo systemctl reload-or-restart dnsmasq

That should bring you up and running and prevent systemd-resolved to run as your DNS resolved at reboot.

This might be because of the lease time. It probably didn’t expire and the new IP has not been assigned to the computer (yet).


#13

The DNSStubListener parameter currently commented out. I did add “DNSStubHandler = no” to the end of file (it wasn’t there) when I followed the instructions from that page.
So just to double check: you want me to turn on both listener and handler parameters and set them to “no”?


#14

Un-comment and set to no. Also change DNSStubHandler = no to DNSStubHandler=no (no spaces).

Then restart systemd-resolved and then restart dnsmasq with the commands from my previous reply.


#15

Good news.
Dnsmasq service is now running and looks like its blocking the stuff.
Now when I log in to admin page. I get “connection to API lost”. and pihole- active and FTP-offline.

I would like to get this working as well.

I am very grateful for your help with this. (Once you start using pi-hole, you can’t go back, doesn’t feel right!).


#16

restart FTL and see if it works: sudo systemctl reload-or-restart pihole-FTL.service


#17

EUREKA!
It worked.

Thank you.


#18

It seems that some systems that were upgraded from 17.10 to 18.04 may be an issue. I’ve seen a few people report dnsmasq running in that configuration.

Clean 18.04 installs do not have dnsmasq running out of the box, everything is handled by systemd. This is also true of systems that have been upgraded from prior LTS versions 16.04 and 14.04.

So at this time I don’t know if it’s something that happens from that particular (17.10 to 18.04) upgrade path, or because of some other change to their installed software.

When I get time I’ll set up 17.10 and upgrade it to 18.04 to see what turns up.


#19

I did clean install of 18.04 (64bit). I didn’t upgrade. If it helps.