Local DNS and DHCP With dnsmasq

Serve DNS names and DHCP leases on a small network.

LinuxnetworkservicesDNSLow risk
Run dnsmasq --test to validate the configuration before starting it.

01Command

Command
$ dnsmasq --test

02What it does

dnsmasq forwards DNS queries, caches answers and can serve names from /etc/hosts or its own config, plus DHCP for a LAN. It is widely used on routers and home labs for its tiny footprint.

03Risk

RiskLow risk
Requirementssudo apt install dnsmasq
!Warning: Binding dnsmasq to a public interface can turn your host into an open resolver; restrict it to your LAN and validate config first.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Debian package: dnsmasq
    Debian · vendor-doc · 2026-09-20
    Evidence: Debian packages dnsmasq, a small caching DNS forwarder and DHCP server.
  • dnsmasq documentation
    Official project · vendor-doc · 2026-09-20
    Evidence: Debian packages dnsmasq, a small caching DNS forwarder and DHCP server.

Last verified: 2026-09-22 · Category: Network

06Related solutions