How imp/dnsmasq works
dnsmasq is a network service providing DNS caching and forwarding, DHCPv4/v6, router advertisements, and TFTP. Its principal workflow is receiving a client request, handling it locally or forwarding DNS upstream, and returning a response; DHCP requests are processed into lease updates and replies. The graph preserves these distinct capabilities and supporting configuration, network, and integration layers. Source excerpts are partial and the README is empty, so unverified runtime connections are shown as dashed rather than treated as confirmed calls.
Main entry points: dnsmasq.c Service runtime · forward.c DNS forwarding · dhcp.c DHCP service · rfc3315.c DHCPv6 processing
Components 20
DNS service
- Service runtime
src/dnsmasq.c - Network listeners
src/network.c - DNS forwarding
src/forward.c - DNS record handling
src/rfc1035.c - Authoritative DNS
src/auth.c - DNSSEC validation
src/dnssec.c
Address configuration
- DHCPv4 processing
src/rfc2131.c - DHCPv6 processing
src/rfc3315.c - DHCP service
src/dhcp.c - Lease state
src/lease.c - Router advertisements
src/radv.c - SLAAC addresses
src/slaac.c
Network services
- TFTP service
src/tftp.c
Configuration and control
- Options and configuration
src/option.c - D-Bus control
src/dbus.c - Ubus control
src/ubus.c
Other components
- DNS and DHCP clients
Connections 20
- DNS and DHCP clients → Network listeners: send requests
- Network listeners → Service runtime: dispatches
- Service runtime → DNS forwarding: handles DNS
- DNS forwarding → DNS and DHCP clients: returns replies
- DNS forwarding → DNS cache: checks cache
- DNS forwarding → DNSSEC validation: validates replies
- DNS forwarding → DNS record handling: uses DNS records
- Service runtime → DHCP service: starts service
- DHCP service → DHCPv4 processing: dispatches DHCPv4
- DHCP service → DHCPv6 processing: dispatches DHCPv6
- DHCPv4 processing → Lease state: updates leases
- DHCPv6 processing → Lease state: updates leases
- Service runtime → Router advertisements: initializes RA
src/dnsmasq.c - Service runtime → DHCPv6 processing: initializes DHCPv6
src/dnsmasq.c - Router advertisements → SLAAC addresses: derives addresses
- Service runtime → Options and configuration: loads options
- Service runtime → D-Bus control: serves control
- Service runtime → Ubus control: serves control
- DNSSEC validation → DNS cache: inserts keys
src/dnssec.c - Authoritative DNS → DNS cache: looks up records
src/auth.c