Example configuration file:
# Listen on internal network interface
interface=eth0
domain=company.local
local=/company.local/
# Upstream public DNS servers
server=1.1.1.3
server=1.0.0.3
server=1.1.1.2
server=1.0.0.2
server=8.8.8.8
server=8.8.4.4
server=1.1.1.1
server=1.0.0.1
# Either or...
strict-order
#all-servers
# DHCP Range and Lease Time (12 hours)
dhcp-range=192.168.1.50,192.168.1.200,255.255.255.0,12h
# Gateway & Local DNS server push
dhcp-option=option:router,192.168.1.1
dhcp-option=option:dns-server,192.168.1.2
# Fixed IPs for core servers (MAC address mapping)
dhcp-host=AA:BB:CC:DD:EE:FF,appserver,192.168.1.10,infinite
### Optional Start ###
# Optional: Read static host definitions from Slackware's standard /etc/hosts file
expand-hosts
# Optional: Prevent forwarding plain names (without dots) to upstream servers
domain-needed
# Optional: Prevent forwarding reverse-DNS lookups for private IP ranges upstream
bogus-priv
### Optional End ###
NOTES:
domain=company.local: Defines your local domain name. When DHCP clients request an IP address, Dnsmasq automatically appends .company.local to their hostname (e.g., a workstation named pc-smith becomes pc-smith.company.local). It also pushes this domain to DHCP clients as their search domain.
local=/company.local/: Directs Dnsmasq to treat any query ending in .company.local as strictly internal. It will never forward queries for .company.local to upstream internet DNS servers. If a local name isn't found in Dnsmasq's lease table or local hosts file, it immediately returns NXDOMAIN (non-existent domain).
option:router (Option 3): Sets the default gateway pushed to clients. In this setup, clients will send all non-local internet traffic through 192.168.1.1.
option:dns-server (Option 6): Tells clients which DNS server address to use. By pointing this to 192.168.1.2 (the IP of your Slackware box running Dnsmasq), all client DNS traffic routes through your local server.
See also here
No comments:
Post a Comment
Note: only a member of this blog may post a comment.