Score:0

How can dnsmasq be listening if it's not running?

es flag

service --status-all shows dnsmasq with a (-) in front of it indicating it's not running.

Yet when I try and run sudo dnsmasq I get the message dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use

So I check what's listening on 127.0.0.1 with sudo ss -alpn sport = 53 src 127.0.0.1 and I get the output:

TCP | LISTEN | 0 | 32 | 127.0.0.1:53 | 0.0.0.0:* | users:(("dnsmasq",pid=3307,fd=5))  

How can it be listening if it's not running?

Score:0
br flag

Try these steps:

Services

Compare service --status-all output with

systemctl list-units --type=service.

Listening ports and applications

Install net-tools and display the list of listening ports including process numbers and names. The nestat is similar to ss, but more compact:

sudo apt-get install net-tools

sudo netstat -lntp

Search for both the port 53 and the dnsmasq name. The dnsmasq can use two ports (DNS and DHCP). Verify no listening application with dnsmasq and no port 53 are listed. If one or both are still listed, display processes by

ps -ef
ps -aux

eventually with full line contents saved in text files to later analysis and filtering using grep:

ps -ef  > list1.txt
ps -aux > list2.txt
ps -eux > list3.txt

Search for process number got from netstat and follow its parent process(es) in list to get order and way how they were started. Process listing will show you the dnsmasq process(es) including configuration file names, paths and other details.

Some applications can be started as a service or as a standalone process. Therefore a collision may occur between two similar processes by this way.

Kill manually unwanted process to free-up port for listening and try start dnsmasq by way you need.

sudo kill -9 <process_number>
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.