2

I discovered an instance of dnsmasq running on my fresh install of xubuntu desktop. The general purpose of dnsmasq is known to be a DNS relay and DHCP server. The running process is reported as follows:

/usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec

Looks like it is spawned by network-manager. Contents of mentioned files are:

#cat /var/run/nm-dns-dnsmasq.conf
server=192.168.2.1

In my local network 192.168.2.1 indeed is a DNS server. I cannot understand why this instance of dnsmasq listens on 127.0.0.1 since I see no way to serve DNS relay and DHCP server on 127.0.0.1 interface.

mbaitoff
  • 397
  • 6
  • 18
  • Looks like a caching DNS server, am I correct? – Lekensteyn May 11 '12 at 17:05
  • What's the purpose of caching DNS info and make it available for `127.0.0.1` only? – mbaitoff May 11 '12 at 20:05
  • Apparantly I was wrong, it's done in an attempt to improve latency issues. See [this AU question](http://askubuntu.com/q/127228/6969) which links to http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/ – Lekensteyn May 11 '12 at 20:51
  • @Lekensteyn: Would you please provide at least a short answer, so I can accept it for my question. – mbaitoff May 12 '12 at 15:50

2 Answers2

4

127.0.0.1 is the loopback address, it is not accessible by other machines, just the machine itself. According to the post http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/, this dnsmasq instance exists to improve performance by trying multiple DNS servers if one is too slow.

Lekensteyn
  • 171,743
  • 65
  • 311
  • 401
  • So for example if a server (like a proxy server) is running on localhost, there's no way other machines could use it? @Lekensteyn – Shayan Aug 27 '19 at 12:35
  • 1
    @Shayan No it is not possible by default. You could set up a proxy (using socat for example) or an iptables NAT rule to redirect traffic, but this requires additional steps. – Lekensteyn Aug 31 '19 at 15:39
-1

It is a DNS server and it'd assign IP addresses to machines that request them from your computer. In this case it'd be used by NetworkManager to share your internet connection. Nothing to worry about :)

pietrek
  • 157
  • 5
  • Assigning IP addresses is the role of DHCP server, not DNS server. This instance of `dnsmasq` doesn't play a role of DHCP server, since there's no `subnet` specification in the configuration file. Moreover, no requests from other machines can arrive from `127.0.0.1` which is the interface this instance is listening on. – mbaitoff May 11 '12 at 00:22