Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computers:truenas:dnsmasq [30-Oct-2021 13:26] – Steve Joynt | computers:truenas:dnsmasq [02-Feb-2025 16:14] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Dnsmasq ====== | + | ====== |
Dnsmasq provides network infrastructure for small networks: DNS, DHCP, router advertisement and network boot. It is designed to be lightweight and have a small footprint, suitable for resource constrained routers and firewalls. It has also been widely used for tethering on smartphones and portable hotspots, and to support virtual networking in virtualisation frameworks. Supported platforms include Linux (with glibc and uclibc), Android, *BSD, and Mac OS X. Dnsmasq is included in most Linux distributions and the ports systems of FreeBSD, OpenBSD and NetBSD. Dnsmasq provides full IPv6 support. | Dnsmasq provides network infrastructure for small networks: DNS, DHCP, router advertisement and network boot. It is designed to be lightweight and have a small footprint, suitable for resource constrained routers and firewalls. It has also been widely used for tethering on smartphones and portable hotspots, and to support virtual networking in virtualisation frameworks. Supported platforms include Linux (with glibc and uclibc), Android, *BSD, and Mac OS X. Dnsmasq is included in most Linux distributions and the ports systems of FreeBSD, OpenBSD and NetBSD. Dnsmasq provides full IPv6 support. | ||
Line 46: | Line 46: | ||
</ | </ | ||
- | 6. Configure the " | + | ====== Configure Dnsmasq ====== |
+ | |||
+ | 1. Configure the " | ||
< | < | ||
jexec " | jexec " | ||
Line 76: | Line 78: | ||
dhcp-name-match=set: | dhcp-name-match=set: | ||
dhcp-ignore-names=tag: | dhcp-ignore-names=tag: | ||
+ | |||
+ | # Add other name servers here, with domain specs if they are for | ||
+ | # non-public domains. | ||
+ | # Google DNS | ||
+ | server=8.8.4.4 | ||
+ | server=8.8.8.8 | ||
+ | # OpenDNS | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Set the cachesize here. | ||
+ | cache-size=1000 | ||
+ | |||
+ | # Set the limit on DHCP leases, the default is 150 | ||
+ | dhcp-lease-max=150 | ||
+ | |||
+ | # The DHCP server needs somewhere on disk to keep its lease database. | ||
+ | # This defaults to a sane location, but if you want to change it, use | ||
+ | # the line below. | ||
+ | dhcp-leasefile=/ | ||
+ | |||
+ | # Set the DHCP server to authoritative mode. In this mode it will barge in | ||
+ | # and take over the lease for any client which broadcasts on the network, | ||
+ | # whether it has a record of the lease or not. This avoids long timeouts | ||
+ | # when a machine wakes up on a new network. DO NOT enable this if there' | ||
+ | # the slightest chance that you might end up accidentally configuring a DHCP | ||
+ | # server for your campus/ | ||
+ | # the same option, and this URL provides more information: | ||
+ | # http:// | ||
+ | dhcp-authoritative | ||
+ | |||
+ | # For debugging purposes, log each DNS query as it passes through | ||
+ | # dnsmasq. | ||
+ | log-queries | ||
+ | |||
+ | # Log lots of extra information about DHCP transactions. | ||
+ | #log-dhcp | ||
END | END | ||
Line 81: | Line 120: | ||
</ | </ | ||
- | 7. Configure the " | + | 2. Configure the " |
< | < | ||
jexec " | jexec " | ||
Line 87: | Line 126: | ||
<<END | <<END | ||
# Bespoke configuration file for dnsmasq | # Bespoke configuration file for dnsmasq | ||
+ | |||
+ | # Uncomment this to enable the integrated DHCP server, you need | ||
+ | # to supply the range of addresses available for lease and optionally | ||
+ | # a lease time. If you have more than one network, you will need to | ||
+ | # repeat this for each network on which you want to supply DHCP | ||
+ | # service. | ||
+ | dhcp-range=192.168.1.200, | ||
+ | |||
+ | # Set the domain for dnsmasq. this is optional, but if it is set, it | ||
+ | # does the following things. | ||
+ | # 1) Allows DHCP hosts to have fully qualified domain names, as long | ||
+ | # as the domain part matches this setting. | ||
+ | # 2) Sets the " | ||
+ | # domain of all systems configured by DHCP | ||
+ | # 3) Provides the domain part for " | ||
+ | domain=net.joynt.org.uk | ||
+ | |||
END | END | ||
</ | </ | ||
- | 8. The " | + | 3. The " |
+ | |||
+ | ====== Starting the Dnsmasq service ====== | ||
- | 9. Start the Dnsmasq server now, and also when the jail boots up. | + | Start the Dnsmasq server now, and also when the jail boots up. |
< | < | ||
jexec " | jexec " |