← Back to all services
Dns

Dnsmasq DNS/DHCP Port & Configuration

dnsmasq systemctl: dnsmasq

Lightweight DNS forwarder and DHCP server. Good for small networks and development.

🔌 Default Ports

53
tcp
DNS
53
udp
DNS
67
udp
DHCP server
68
udp
DHCP client

📦 Installation Command

apt install dnsmasq

⚙️ Configuration Files

  • /etc/dnsmasq.conf
  • /etc/dnsmasq.d/
  • /etc/hosts

📂 Default Directories

  • config: /etc/dnsmasq.conf
  • data: /var/lib/misc/dnsmasq.leases
  • logs: /var/log/syslog
  • hosts: /etc/hosts

🔐 Default Credentials

Username:N/A
Password:N/A
💡 No authentication - configuration file based

⚠️ Conflicts

bind9 (port 53)systemd-resolved (port 53) Port: bind9Port: systemd-resolvedPort: isc-dhcp-server

✅ Works With

libvirtlxddocker

🛡️ Security Notes

Bind to specific interfaces, disable DHCP if not needed, use bogus-priv and domain-needed options

❓ Frequently Asked Questions

What port does Dnsmasq use?
Dnsmasq uses port 53 for DNS and optionally port 67 for DHCP.
Dnsmasq vs BIND9?
Dnsmasq is lightweight for small networks. BIND9 is full-featured for large deployments.
Where is Dnsmasq config?
Config at /etc/dnsmasq.conf or /etc/dnsmasq.d/.