dnsmasq

dnsmasq DNS Forwarder / DHCP Server

SystemPerformanceSecurity
CPU Usage
N/A
Memory
N/A
Location
N/A
Publisher
N/A

Dnsmasq Role
[object Object]

What is dnsmasq?

dnsmasq is a compact, open source network service designed to deliver DNS caching, DNS forwarding to upstream resolvers, and DHCP services for small networks and embedded devices. It consolidates multiple functions into a single daemon, reducing upstream DNS traffic while offering straightforward configuration through /etc/dnsmasq.conf or drop-in files.

dnsmasq runs as a single daemon that listens on UDP/TCP port 53 for DNS queries and on DHCP ports to lease addresses. It supports DHCPv4/v6, DNS caching, and simple host name resolution, making it ideal for tiny LANs, home routers, and lightweight appliances.

Is dnsmasq Safe?

dnsmasq is generally safe when obtained from official repositories and configured with sensible access controls. It is widely used in home routers, Linux desktops, and embedded devices to provide efficient DNS caching, DHCP services, and basic local name resolution. Always secure network interfaces, limit exposure, and keep the package up to date.

Is dnsmasq a Virus?

dnsmasq is not a virus by design; it is a legitimate, open source daemon. However, attackers may modify or replace the binary if the system is compromised or if installations come from untrusted sources. Always verify the binary location, provenance, and signatures, and monitor for unexpected network behavior.

How to Verify Legitimacy

  1. Check File Location: Confirm the dnsmasq binary resides at a canonical path such as /usr/sbin/dnsmasq or /usr/local/sbin/dnsmasq and that no suspicious copies exist in user-writable directories.
  2. Verify Digital Signature: On systems using package managers, verify the installed package signature (e.g., dpkg -V or rpm -V) and compare with the official repository.
  3. Check File Hash: Compute the SHA256 hash of the binary (e.g., sha256sum /usr/sbin/dnsmasq) and compare against the known, published hash from the distro.
  4. Scan for Malware: Run a malware scan on the binary and system directories with a trusted scanner (e.g., rkhunter, ClamAV) and review for unexpected modifications.

Red Flags: If dnsmasq is found in non-standard locations, is running from a directory writable by non-privileged users, or if DNS responses appear malformed or suspicious, treat it as a potential compromise and investigate.

Why is it Running?

Reasons it's running:

Can I Disable or Remove It?

Common Problems

Common Causes & Solutions

Frequently Asked Questions

What is dnsmasq and what does it do?

Dnsmasq is a lightweight DNS forwarder, DNS caching server, and DHCP server designed for small networks. It simplifies network management on Linux desktops, embedded devices, and routers by providing local name resolution, efficient DNS caching, and automatic IP address assignment.

Is dnsmasq safe to run on my home network?

Yes, dnsmasq is safe when installed from official repositories and properly configured. Limit interfaces, disable DHCP on untrusted networks, and keep it updated to reduce attack surface.

How do I install dnsmasq on Linux?

Install dnsmasq from your distribution's package manager (e.g., apt install dnsmasq on Debian/Ubuntu or pacman -S dnsmasq on Arch). Start and enable the service, then edit /etc/dnsmasq.conf to tailor DNS and DHCP settings.

How do I configure dnsmasq as a DHCP server?

Edit /etc/dnsmasq.conf to set a dhcp-range, dhcp-option for gateway and DNS servers, and specify the interface (e.g., interface=eth0). Restart dnsmasq to apply the changes and verify leases with dnsmasq/dhcp leases.

Which ports does dnsmasq use?

Dnsmasq uses UDP/TCP port 53 for DNS and UDP port 67 for DHCP (and 68 for client responses in IPv4). Depending on configuration, it may also forward queries to upstream DNS servers on port 53.

How can I disable or remove dnsmasq?

To disable, stop and disable the dnsmasq service and remove its configuration if desired. On routers or embedded devices, disable the DNS/DHCP options in the firmware UI and reboot.

Related Processes