Diff for /embedaddon/dnsmasq/man/dnsmasq.8 between versions 1.1.1.3 and 1.1.1.4

version 1.1.1.3, 2016/11/02 09:57:01 version 1.1.1.4, 2021/03/17 00:56:46
Line 1 Line 1
.TH DNSMASQ 8.TH DNSMASQ 8 2020-04-05
 .SH NAME  .SH NAME
 dnsmasq \- A lightweight DHCP and caching DNS server.  dnsmasq \- A lightweight DHCP and caching DNS server.
 .SH SYNOPSIS  .SH SYNOPSIS
Line 27  TFTP server to allow net/PXE boot of DHCP hosts and al Line 27  TFTP server to allow net/PXE boot of DHCP hosts and al
 .PP  .PP
 The dnsmasq DHCPv6 server provides the same set of features as the  The dnsmasq DHCPv6 server provides the same set of features as the
 DHCPv4 server, and in addition, it includes router advertisements and  DHCPv4 server, and in addition, it includes router advertisements and
a neat feature which allows nameing for clients which use DHCPv4 anda neat feature which allows naming for clients which use DHCPv4 and
 stateless autoconfiguration only for IPv6 configuration. There is support for doing address allocation (both DHCPv6 and RA) from subnets which are dynamically delegated via DHCPv6 prefix delegation.  stateless autoconfiguration only for IPv6 configuration. There is support for doing address allocation (both DHCPv6 and RA) from subnets which are dynamically delegated via DHCPv6 prefix delegation.
 .PP  .PP
Dnsmasq is coded with small embedded systems in mind. It aims for the smallest possible memory footprint compatible with the supported functions,  and allows uneeded functions to be omitted from the compiled binary.  Dnsmasq is coded with small embedded systems in mind. It aims for the smallest possible memory footprint compatible with the supported functions,  and allows unneeded functions to be omitted from the compiled binary.  
 .SH OPTIONS  .SH OPTIONS
 Note that in general missing parameters are allowed and switch off  Note that in general missing parameters are allowed and switch off
 functions, for instance "--pid-file" disables writing a PID file. On  functions, for instance "--pid-file" disables writing a PID file. On
Line 53  will display DHCPv6 options. Line 53  will display DHCPv6 options.
 Don't read the hostnames in /etc/hosts.  Don't read the hostnames in /etc/hosts.
 .TP  .TP
 .B \-H, --addn-hosts=<file>  .B \-H, --addn-hosts=<file>
Additional hosts file. Read the specified file as well as /etc/hosts. If -h is given, readAdditional hosts file. Read the specified file as well as /etc/hosts. If \fB--no-hosts\fP is given, read
 only the specified file. This option may be repeated for more than one  only the specified file. This option may be repeated for more than one
 additional hosts file. If a directory is given, then read all the files contained in that directory.   additional hosts file. If a directory is given, then read all the files contained in that directory. 
 .TP  .TP
 .B --hostsdir=<path>  .B --hostsdir=<path>
 Read all the hosts files contained in the directory. New or changed files  Read all the hosts files contained in the directory. New or changed files
are read automatically. See --dhcp-hostsdir for details.are read automatically. See \fB--dhcp-hostsdir\fP for details.
 .TP  .TP
 .B \-E, --expand-hosts  .B \-E, --expand-hosts
 Add the domain to simple names (without a period) in /etc/hosts  Add the domain to simple names (without a period) in /etc/hosts
Line 76  reduce the load on the server at the expense of client Line 76  reduce the load on the server at the expense of client
 data under some circumstances.  data under some circumstances.
 .TP  .TP
 .B --dhcp-ttl=<time>  .B --dhcp-ttl=<time>
As for --local-ttl, but affects only replies with information from DHCP leases. If both are given, --dhcp-ttl applies for DHCP information, and --local-ttl for others. Setting this to zero eliminates the effect of --local-ttl for DHCP.As for \fB--local-ttl\fP, but affects only replies with information from DHCP leases. If both are given, \fB--dhcp-ttl\fP applies for DHCP information, and \fB--local-ttl\fP for others. Setting this to zero eliminates the effect of \fB--local-ttl\fP for DHCP.
 .TP  .TP
 .B --neg-ttl=<time>  .B --neg-ttl=<time>
 Negative replies from upstream servers normally contain time-to-live  Negative replies from upstream servers normally contain time-to-live
Line 115  don't change user id, generate a complete cache dump o Line 115  don't change user id, generate a complete cache dump o
 SIGUSR1, log to stderr as well as syslog, don't fork new processes  SIGUSR1, log to stderr as well as syslog, don't fork new processes
 to handle TCP queries. Note that this option is for use in debugging  to handle TCP queries. Note that this option is for use in debugging
 only, to stop dnsmasq daemonising in production, use   only, to stop dnsmasq daemonising in production, use 
.B -k..B --keep-in-foreground.
 .TP  .TP
 .B \-q, --log-queries  .B \-q, --log-queries
 Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1. If the argument "extra" is supplied, ie  Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1. If the argument "extra" is supplied, ie
Line 156  can be over-ridden with this switch. Line 156  can be over-ridden with this switch.
 .TP  .TP
 .B \-g, --group=<groupname>   .B \-g, --group=<groupname> 
 Specify the group which dnsmasq will run  Specify the group which dnsmasq will run
as. The defaults to "dip", if available, to facilitate access toas. The default is "dip", if available, to facilitate access to
 /etc/ppp/resolv.conf which is not normally world readable.  /etc/ppp/resolv.conf which is not normally world readable.
 .TP  .TP
 .B \-v, --version  .B \-v, --version
Line 182  OS: this was the default behaviour in versions prior t Line 182  OS: this was the default behaviour in versions prior t
 Do not use ports less than that given as source for outbound DNS  Do not use ports less than that given as source for outbound DNS
 queries. Dnsmasq picks random ports as source for outbound queries:  queries. Dnsmasq picks random ports as source for outbound queries:
 when this option is given, the ports used will always to larger  when this option is given, the ports used will always to larger
than that specified. Useful for systems behind firewalls. than that specified. Useful for systems behind firewalls. If not specified,
 defaults to 1024.
 .TP  .TP
 .B --max-port=<port>  .B --max-port=<port>
 Use ports lower than that given as source for outbound DNS queries.  Use ports lower than that given as source for outbound DNS queries.
Line 190  Dnsmasq picks random ports as source for outbound quer Line 191  Dnsmasq picks random ports as source for outbound quer
 when this option is given, the ports used will always be lower  when this option is given, the ports used will always be lower
 than that specified. Useful for systems behind firewalls.  than that specified. Useful for systems behind firewalls.
 .TP  .TP
   
 .B \-i, --interface=<interface name>  .B \-i, --interface=<interface name>
 Listen only on the specified interface(s). Dnsmasq automatically adds  Listen only on the specified interface(s). Dnsmasq automatically adds
 the loopback (local) interface to the list of interfaces to use when  the loopback (local) interface to the list of interfaces to use when
Line 203  or Line 203  or
 options are given dnsmasq listens on all available interfaces except any  options are given dnsmasq listens on all available interfaces except any
 given in  given in
 .B \--except-interface  .B \--except-interface
options. IP alias interfaces (eg "eth1:0") cannot be used withoptions. On Linux, when
.B --interface.B \--bind-interfaces
 or  or
.B --except-interface.B \--bind-dynamic
options, use --listen-address instead. A simple wildcard, consistingare in effect, IP alias interface labels (eg "eth1:0") are checked, rather than
of a trailing '*', can be used in interface names. In the degenerate case when an interface has one address, this amounts to the same thing but when an interface has multiple addresses it
 allows control over which of those addresses are accepted.
 The same effect is achievable in default mode by using
 .B \--listen-address.
 A simple wildcard, consisting of a trailing '*',
 can be used in
 .B \--interface   .B \--interface 
 and  and
 .B \--except-interface  .B \--except-interface
Line 222  and Line 227  and
 .B --except-interface  .B --except-interface
 options does not matter and that   options does not matter and that 
 .B --except-interface  .B --except-interface
options always override the others.options always override the others. The comments about interface labels for
 .B --listen-address
 apply here.
 .TP  .TP
.B --auth-server=<domain>,<interface>|<ip-address>.B --auth-server=<domain>,[<interface>|<ip-address>...]
 Enable DNS authoritative mode for queries arriving at an interface or address. Note that the interface or address  Enable DNS authoritative mode for queries arriving at an interface or address. Note that the interface or address
 need not be mentioned in   need not be mentioned in 
 .B --interface  .B --interface
Line 232  or  Line 239  or 
 .B --listen-address  .B --listen-address
 configuration, indeed  configuration, indeed
 .B --auth-server  .B --auth-server
will overide these and provide a different DNS service on thewill override these and provide a different DNS service on the
 specified interface. The <domain> is the "glue record". It should  specified interface. The <domain> is the "glue record". It should
resolve in the global DNS to a A and/or AAAA record which points toresolve in the global DNS to an A and/or AAAA record which points to
 the address dnsmasq is listening on. When an interface is specified,  the address dnsmasq is listening on. When an interface is specified,
 it may be qualified with "/4" or "/6" to specify only the IPv4 or IPv6  it may be qualified with "/4" or "/6" to specify only the IPv4 or IPv6
addresses associated with the interface.addresses associated with the interface. Since any defined authoritative zones are also available as part of the normal recusive DNS service supplied by dnsmasq, it can make sense to have an --auth-server declaration with no interfaces or address, but simply specifying the primary external nameserver.
 .TP  .TP
 .B --local-service  .B --local-service
 Accept DNS queries only from hosts whose address is on a local subnet,  Accept DNS queries only from hosts whose address is on a local subnet,
 ie a subnet for which an interface exists on the server. This option  ie a subnet for which an interface exists on the server. This option
only has effect is there are no --interface --except-interface,only has effect if there are no \fB--interface\fP, \fB--except-interface\fP,
--listen-address or --auth-server options. It is intended to be set as\fB--listen-address\fP or \fB--auth-server\fP options. It is intended to be set as
 a default on installation, to allow unconfigured installations to be  a default on installation, to allow unconfigured installations to be
 useful but also safe from being used for DNS amplification attacks.  useful but also safe from being used for DNS amplification attacks.
 .TP   .TP 
Line 286  addresses appear, it automatically listens on those (s Line 293  addresses appear, it automatically listens on those (s
 access-control configuration). This makes dynamically created  access-control configuration). This makes dynamically created
 interfaces work in the same way as the default. Implementing this  interfaces work in the same way as the default. Implementing this
 option requires non-standard networking APIs and it is only available  option requires non-standard networking APIs and it is only available
under Linux. On other platforms it falls-back to --bind-interfaces mode.under Linux. On other platforms it falls-back to \fB--bind-interfaces\fP mode.
 .TP  .TP
 .B \-y, --localise-queries  .B \-y, --localise-queries
Return answers to DNS queries from /etc/hosts which depend on the interface over which the query wasReturn answers to DNS queries from /etc/hosts and \fB--interface-name\fP which depend on the interface over which the query was
received. If a name in /etc/hosts has more than one address associated withreceived. If a name has more than one address associated with
 it, and at least one of those addresses is on the same subnet as the  it, and at least one of those addresses is on the same subnet as the
 interface to which the query was sent, then return only the  interface to which the query was sent, then return only the
 address(es) on that subnet. This allows for a server  to have multiple  address(es) on that subnet. This allows for a server  to have multiple
Line 301  attached to. Currently this facility is limited to IPv Line 308  attached to. Currently this facility is limited to IPv
 .B \-b, --bogus-priv  .B \-b, --bogus-priv
 Bogus private reverse lookups. All reverse lookups for private IP ranges (ie 192.168.x.x, etc)  Bogus private reverse lookups. All reverse lookups for private IP ranges (ie 192.168.x.x, etc)
 which are not found in /etc/hosts or the DHCP leases file are answered  which are not found in /etc/hosts or the DHCP leases file are answered
with "no such domain" rather than being forwarded upstream.with "no such domain" rather than being forwarded upstream. The 
 set of prefixes affected is the list given in RFC6303, for IPv4 and IPv6.
 .TP  .TP
 .B \-V, --alias=[<old-ip>]|[<start-ip>-<end-ip>],<new-ip>[,<mask>]  .B \-V, --alias=[<old-ip>]|[<start-ip>-<end-ip>],<new-ip>[,<mask>]
 Modify IPv4 addresses returned from upstream nameservers; old-ip is  Modify IPv4 addresses returned from upstream nameservers; old-ip is
Line 358  been built with DBus support. If the service name is g Line 366  been built with DBus support. If the service name is g
 provides service at that name, rather than the default which is   provides service at that name, rather than the default which is 
 .B uk.org.thekelleys.dnsmasq  .B uk.org.thekelleys.dnsmasq
 .TP   .TP 
   .B --enable-ubus[=<service-name>]
   Enable dnsmasq UBus interface. It sends notifications via UBus on
   DHCPACK and DHCPRELEASE events. Furthermore it offers metrics.
   Requires that dnsmasq has been built with UBus support. If the service
   name is given, dnsmasq provides service at that namespace, rather than
   the default which is
   .B dnsmasq
   .TP
 .B \-o, --strict-order  .B \-o, --strict-order
 By default, dnsmasq will send queries to any of the upstream servers  By default, dnsmasq will send queries to any of the upstream servers
 it knows about and tries to favour servers that are known to  it knows about and tries to favour servers that are known to
Line 382  were previously disabled. Line 398  were previously disabled.
 .TP  .TP
 .B --stop-dns-rebind  .B --stop-dns-rebind
 Reject (and log) addresses from upstream nameservers which are in the  Reject (and log) addresses from upstream nameservers which are in the
private IP ranges. This blocks an attack where a browser behind aprivate ranges. This blocks an attack where a browser behind a
firewall is used to probe machines on the local network.firewall is used to probe machines on the local network. For IPv6, the
 private range covers the IPv4-mapped addresses in private space plus
 all link-local (LL) and site-local (ULA) addresses.
 .TP  .TP
 .B --rebind-localhost-ok  .B --rebind-localhost-ok
Exempt 127.0.0.0/8 from rebinding checks. This address range isExempt 127.0.0.0/8 and ::1 from rebinding checks. This address range is
 returned by realtime black hole servers, so blocking it may disable  returned by realtime black hole servers, so blocking it may disable
 these services.  these services.
 .TP   .TP 
 .B  --rebind-domain-ok=[<domain>]|[[/<domain>/[<domain>/]  .B  --rebind-domain-ok=[<domain>]|[[/<domain>/[<domain>/]
 Do not detect and block dns-rebind on queries to these domains. The  Do not detect and block dns-rebind on queries to these domains. The
 argument may be either a single domain, or multiple domains surrounded  argument may be either a single domain, or multiple domains surrounded
by '/', like the --server syntax, eg. by '/', like the \fB--server\fP syntax, eg.
 .B  --rebind-domain-ok=/domain1/domain2/domain3/  .B  --rebind-domain-ok=/domain1/domain2/domain3/
 .TP  .TP
 .B \-n, --no-poll  .B \-n, --no-poll
Line 410  Tells dnsmasq to never forward A or AAAA queries for p Line 428  Tells dnsmasq to never forward A or AAAA queries for p
 or domain parts, to upstream nameservers. If the name is not known  or domain parts, to upstream nameservers. If the name is not known
 from /etc/hosts or DHCP then a "not found" answer is returned.  from /etc/hosts or DHCP then a "not found" answer is returned.
 .TP  .TP
.B \-S, --local, --server=[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]].B \-S, --local, --server=[/[<domain>]/[domain/]][<ipaddr>[#<port>]][@<source-ip>|<interface>[#<port>]]
 Specify IP address of upstream servers directly. Setting this flag does  Specify IP address of upstream servers directly. Setting this flag does
not suppress reading of /etc/resolv.conf, use -R to do that. If one ornot suppress reading of /etc/resolv.conf, use \fB--no-resolv\fP to do that. If one or more
more  
 optional domains are given, that server is used only for those domains  optional domains are given, that server is used only for those domains
 and they are queried only using the specified server. This is  and they are queried only using the specified server. This is
 intended for private nameservers: if you have a nameserver on your  intended for private nameservers: if you have a nameserver on your
 network which deals with names of the form  network which deals with names of the form
 xxx.internal.thekelleys.org.uk at 192.168.1.1 then giving  the flag   xxx.internal.thekelleys.org.uk at 192.168.1.1 then giving  the flag 
.B -S /internal.thekelleys.org.uk/192.168.1.1 .B --server=/internal.thekelleys.org.uk/192.168.1.1
 will send all queries for  will send all queries for
 internal machines to that nameserver, everything else will go to the  internal machines to that nameserver, everything else will go to the
 servers in /etc/resolv.conf. DNSSEC validation is turned off for such  servers in /etc/resolv.conf. DNSSEC validation is turned off for such
Line 431  has the special meaning of "unqualified names only" ie Line 448  has the special meaning of "unqualified names only" ie
 dots in them. A non-standard port may be specified as   dots in them. A non-standard port may be specified as 
 part of the IP  part of the IP
 address using a # character.  address using a # character.
More than one -S flag is allowed, withMore than one \fB--server\fP flag is allowed, with
 repeated domain or ipaddr parts as required.  repeated domain or ipaddr parts as required.
   
More specific domains take precendence over less specific domains, so:More specific domains take precedence over less specific domains, so:
 .B --server=/google.com/1.2.3.4  .B --server=/google.com/1.2.3.4
 .B --server=/www.google.com/2.3.4.5  .B --server=/www.google.com/2.3.4.5
 will send queries for *.google.com to 1.2.3.4, except *www.google.com,  will send queries for *.google.com to 1.2.3.4, except *www.google.com,
Line 451  flag which gives a domain but no IP address; this tell Line 468  flag which gives a domain but no IP address; this tell
 a domain is local and it may answer queries from /etc/hosts or DHCP  a domain is local and it may answer queries from /etc/hosts or DHCP
 but should never forward queries on that domain to any upstream  but should never forward queries on that domain to any upstream
 servers.  servers.
.B local.B --local
 is a synonym for  is a synonym for
.B server.B --server
 to make configuration files clearer in this case.  to make configuration files clearer in this case.
   
IPv6 addresses may include a %interface scope-id, egIPv6 addresses may include an %interface scope-id, eg
 fe80::202:a412:4512:7bbf%eth0.  fe80::202:a412:4512:7bbf%eth0.
   
The optional string after the @ character tellsThe optional string after the @ character tells dnsmasq how to set the source of
dnsmasq how to set the source of the queries to thisthe queries to this nameserver. It can either be an ip-address, an interface
nameserver. It should be an ip-address, which should belong to the machine on whichname or both. The ip-address should belong to the machine on which dnsmasq is
dnsmasq is running otherwise this server line will be logged and thenrunning, otherwise this server line will be logged and then ignored. If an
ignored, or an interface name. If an interface name is given, theninterface name is given, then queries to the server will be forced via that
queries to the server will be forced via that interface; if aninterface; if an ip-address is given then the source address of the queries will
ip-address is given then the source address of the queries will be setbe set to that address; and if both are given then a combination of ip-address
to that address.and interface name will be used to steer requests to the server.
 The query-port flag is ignored for any servers which have a  The query-port flag is ignored for any servers which have a
 source address specified but the port may be specified directly as  source address specified but the port may be specified directly as
 part of the source address. Forcing queries to an interface is not  part of the source address. Forcing queries to an interface is not
 implemented on all platforms supported by dnsmasq.  implemented on all platforms supported by dnsmasq.
 .TP  .TP
.B --rev-server=<ip-address>/<prefix-len>,<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]].B --rev-server=<ip-address>/<prefix-len>[,<ipaddr>][#<port>][@<source-ip>|<interface>[#<port>]]
 This is functionally the same as   This is functionally the same as 
 .B --server,   .B --server, 
 but provides some syntactic sugar to make specifying address-to-name queries easier. For example  but provides some syntactic sugar to make specifying address-to-name queries easier. For example
Line 480  but provides some syntactic sugar to make specifying a Line 497  but provides some syntactic sugar to make specifying a
 is exactly equivalent to   is exactly equivalent to 
 .B --server=/3.2.1.in-addr.arpa/192.168.0.1  .B --server=/3.2.1.in-addr.arpa/192.168.0.1
 .TP  .TP
.B \-A, --address=/<domain>/[domain/][<ipaddr>].B \-A, --address=/<domain>[/<domain>...]/[<ipaddr>]
 Specify an IP address to return for any host in the given domains.  Specify an IP address to return for any host in the given domains.
 Queries in the domains are never forwarded and always replied to  Queries in the domains are never forwarded and always replied to
 with the specified IP address which may be IPv4 or IPv6. To give  with the specified IP address which may be IPv4 or IPv6. To give
both IPv4 and IPv6 addresses for a domain, use repeated -A flags.both IPv4 and IPv6 addresses for a domain, use repeated \fB--address\fP flags.
 To include multiple IP addresses for a single query, use
 \fB--addn-hosts=<path>\fP instead.
 Note that /etc/hosts and DHCP leases override this for individual  Note that /etc/hosts and DHCP leases override this for individual
 names. A common use of this is to redirect the entire doubleclick.net  names. A common use of this is to redirect the entire doubleclick.net
 domain to some friendly local web server to avoid banner ads. The  domain to some friendly local web server to avoid banner ads. The
domain specification works in the same was as for --server, with thedomain specification works in the same was as for \fB--server\fP, with
additional facility that /#/ matches any domain. Thusthe additional facility that \fB/#/\fP matches any domain. Thus
--address=/#/1.2.3.4 will always return 1.2.3.4 for any query not\fB--address=/#/1.2.3.4\fP will always return \fB1.2.3.4\fP for any
answered from /etc/hosts or DHCP and not sent to an upstreamquery not answered from \fB/etc/hosts\fP or DHCP and not sent to an
nameserver by a more specific --server directive. As for --server,upstream nameserver by a more specific \fB--server\fP directive. As for
one or more domains with no address returns a no-such-domain answer, so\fB--server\fP, one or more domains with no address returns a
--address=/example.com/ is equivalent to --server=/example.com/ and returns no-such-domain answer, so \fB--address=/example.com/\fP is equivalent to
NXDOMAIN for example.com and all its subdomains.\fB--server=/example.com/\fP and returns NXDOMAIN for example.com and
 all its subdomains. An address specified as '#' translates to the NULL
 address of 0.0.0.0 and its IPv6 equivalent of :: so
 \fB--address=/example.com/#\fP will return NULL addresses for example.com and
 its subdomains. This is partly syntactic sugar for \fB--address=/example.com/0.0.0.0\fP
 and \fB--address=/example.com/::\fP but is also more efficient than including both
 as separate configuration lines. Note that NULL addresses normally work in the same way as localhost, so beware that clients looking up these names are likely to end up talking to themselves.
 .TP  .TP
.B --ipset=/<domain>/[domain/]<ipset>[,<ipset>].B --ipset=/<domain>[/<domain>...]/<ipset>[,<ipset>...]
Places the resolved IP addresses of queries for the specified domainsPlaces the resolved IP addresses of queries for one or more domains in
in the specified netfilter ip sets. Domains and subdomains are matchedthe specified Netfilter IP set. If multiple setnames are given, then the
in the same way as --address. These ip sets must already exist. Seeaddresses are placed in each of them, subject to the limitations of an
ipset(8) for more details.IP set (IPv4 addresses cannot be stored in an IPv6 IP set and vice
 versa).  Domains and subdomains are matched in the same way as
 \fB--address\fP.
 These IP sets must already exist. See
 .BR ipset (8)
 for more details.
 .TP  .TP
 .B \-m, --mx-host=<mx name>[[,<hostname>],<preference>]  .B \-m, --mx-host=<mx name>[[,<hostname>],<preference>]
 Return an MX record named <mx name> pointing to the given hostname (if  Return an MX record named <mx name> pointing to the given hostname (if
 given), or  given), or
the host specified in the --mx-target switchthe host specified in the \fB--mx-target\fP switch
 or, if that switch is not given, the host on which dnsmasq   or, if that switch is not given, the host on which dnsmasq 
 is running. The default is useful for directing mail from systems on a LAN  is running. The default is useful for directing mail from systems on a LAN
 to a central server. The preference value is optional, and defaults to  to a central server. The preference value is optional, and defaults to
Line 514  to a central server. The preference value is optional, Line 544  to a central server. The preference value is optional,
 .TP   .TP 
 .B \-t, --mx-target=<hostname>  .B \-t, --mx-target=<hostname>
 Specify the default target for the MX record returned by dnsmasq. See  Specify the default target for the MX record returned by dnsmasq. See
--mx-host.  If --mx-target is given, but not --mx-host, then dnsmasq\fB--mx-host\fP.  If \fB--mx-target\fP is given, but not \fB--mx-host\fP, then dnsmasq
 returns a MX record containing the MX target for MX queries on the   returns a MX record containing the MX target for MX queries on the 
 hostname of the machine on which dnsmasq is running.  hostname of the machine on which dnsmasq is running.
 .TP  .TP
Line 523  Return an MX record pointing to itself for each local Line 553  Return an MX record pointing to itself for each local
 machine. Local machines are those in /etc/hosts or with DHCP leases.  machine. Local machines are those in /etc/hosts or with DHCP leases.
 .TP   .TP 
 .B \-L, --localmx  .B \-L, --localmx
Return an MX record pointing to the host given by mx-target (or theReturn an MX record pointing to the host given by \fB--mx-target\fP (or the
 machine on which dnsmasq is running) for each  machine on which dnsmasq is running) for each
 local machine. Local machines are those in /etc/hosts or with DHCP  local machine. Local machines are those in /etc/hosts or with DHCP
 leases.  leases.
Line 543  all that match are returned. Line 573  all that match are returned.
 Add A, AAAA and PTR records to the DNS. This adds one or more names to  Add A, AAAA and PTR records to the DNS. This adds one or more names to
 the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may  the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
 appear in more than one   appear in more than one 
.B host-record.B --host-record
 and therefore be assigned more than one address. Only the first  and therefore be assigned more than one address. Only the first
 address creates a PTR record linking the address to the name. This is  address creates a PTR record linking the address to the name. This is
 the same rule as is used reading hosts-files.   the same rule as is used reading hosts-files. 
.B host-record.B --host-record
 options are considered to be read before host-files, so a name  options are considered to be read before host-files, so a name
 appearing there inhibits PTR-record creation if it appears in  appearing there inhibits PTR-record creation if it appears in
 hosts-file also. Unlike hosts-files, names are not expanded, even when  hosts-file also. Unlike hosts-files, names are not expanded, even when
.B expand-hosts.B --expand-hosts
 is in effect. Short and long names may appear in the same   is in effect. Short and long names may appear in the same 
.B host-record,.B --host-record,
 eg.   eg. 
 .B --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100  .B --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100
   
 If the time-to-live is given, it overrides the default, which is zero  If the time-to-live is given, it overrides the default, which is zero
or the value of --local-ttl. The value is a positive integer and gives or the value of \fB--local-ttl\fP. The value is a positive integer and gives
 the time-to-live in seconds.  the time-to-live in seconds.
 .TP  .TP
 .B \-Y, --txt-record=<name>[[,<text>],<text>]  .B \-Y, --txt-record=<name>[[,<text>],<text>]
Line 573  Return a PTR DNS record. Line 603  Return a PTR DNS record.
 .B --naptr-record=<name>,<order>,<preference>,<flags>,<service>,<regexp>[,<replacement>]  .B --naptr-record=<name>,<order>,<preference>,<flags>,<service>,<regexp>[,<replacement>]
 Return an NAPTR DNS record, as specified in RFC3403.  Return an NAPTR DNS record, as specified in RFC3403.
 .TP  .TP
.B --cname=<cname>,<target>[,<TTL>].B --caa-record=<name>,<flags>,<tag>,<value>
 Return a CAA DNS record, as specified in RFC6844.
 .TP
 .B --cname=<cname>,[<cname>,]<target>[,<TTL>]
 Return a CNAME record which indicates that <cname> is really  Return a CNAME record which indicates that <cname> is really
<target>. There are significant limitations on the target; it must be a<target>. There is a significant limitation on the target; it must be a
DNS name which is known to dnsmasq from /etc/hosts (or additionalDNS record which is known to dnsmasq and NOT a DNS record which comes from
hosts files), from DHCP, from --interface-name or from another an upstream server. The cname must be unique, but it
.B --cname.is permissible to have more than one cname pointing to the same target. Indeed
If the target does not satisfy thisit's possible to declare multiple cnames to a target in a single line, like so:
criteria, the whole cname is ignored. The cname must be unique, but it.B --cname=cname1,cname2,target
is permissable to have more than one cname pointing to the same target. 
   
 If the time-to-live is given, it overrides the default, which is zero  If the time-to-live is given, it overrides the default, which is zero
or the value of -local-ttl. The value is a positive integer and gives or the value of \fB--local-ttl\fP. The value is a positive integer and gives
 the time-to-live in seconds.  the time-to-live in seconds.
 .TP  .TP
 .B --dns-rr=<name>,<RR-number>,[<hex data>]  .B --dns-rr=<name>,<RR-number>,[<hex data>]
Line 594  given by the hex data, which may be of the form 01:23: Line 626  given by the hex data, which may be of the form 01:23:
 012345 or any mixture of these.  012345 or any mixture of these.
 .TP  .TP
 .B --interface-name=<name>,<interface>[/4|/6]  .B --interface-name=<name>,<interface>[/4|/6]
Return a DNS record associating the name with the primary address onReturn DNS records associating the name with the address(es) of
 the given interface. This flag specifies an A or AAAA record for the given  the given interface. This flag specifies an A or AAAA record for the given
 name in the same way as an /etc/hosts line, except that the address is  name in the same way as an /etc/hosts line, except that the address is
 not constant, but taken from the given interface. The interface may be  not constant, but taken from the given interface. The interface may be
Line 604  down, not configured or non-existent, an empty record  Line 636  down, not configured or non-existent, an empty record 
 matching PTR record is also created, mapping the interface address to  matching PTR record is also created, mapping the interface address to
 the name. More than one name may be associated with an interface  the name. More than one name may be associated with an interface
 address by repeating the flag; in that case the first instance is used  address by repeating the flag; in that case the first instance is used
for the reverse address-to-name mapping.for the reverse address-to-name mapping. Note that a name used in 
 \fB--interface-name\fP may not appear in /etc/hosts.
 .TP  .TP
.B --synth-domain=<domain>,<address range>[,<prefix>].B --synth-domain=<domain>,<address range>[,<prefix>[*]]
 Create artificial A/AAAA and PTR records for an address range. The  Create artificial A/AAAA and PTR records for an address range. The
records use the address, with periods (or colons for IPv6) replacedrecords either seqential numbers or the address, with periods (or colons for IPv6) replaced with dashes.
with dashes. 
   
An example should make this clearer.An examples should make this clearer. First sequential numbers.
.B --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal-.B --synth-domain=thekelleys.org.uk,192.168.0.50,192.168.0.70,internal-*
 results in the name internal-0.thekelleys.org.uk. returning 192.168.0.50, internal-1.thekelleys.org.uk returning 192.168.0.51 and so on. (note the *) The same principle applies to IPv6 addresses (where the numbers may be very large). Reverse lookups from address to name behave as expected.
 
 Second, 
 .B --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal- (no *)
 will result in a query for internal-192-168-0-56.thekelleys.org.uk returning  will result in a query for internal-192-168-0-56.thekelleys.org.uk returning
 192.168.0.56 and a reverse query vice versa. The same applies to IPv6,  192.168.0.56 and a reverse query vice versa. The same applies to IPv6,
 but IPv6 addresses may start with '::'  but IPv6 addresses may start with '::'
 but DNS labels may not start with '-' so in this case if no prefix is  but DNS labels may not start with '-' so in this case if no prefix is
 configured a zero is added in front of the label. ::1 becomes 0--1.  configured a zero is added in front of the label. ::1 becomes 0--1.
   
   V4 mapped IPv6 addresses, which have a representation like ::ffff:1.2.3.4 are handled specially, and become like 0--ffff-1-2-3-4
   
 The address range can be of the form  The address range can be of the form
<ip address>,<ip address> or <ip address>/<netmask><ip address>,<ip address> or <ip address>/<netmask> in both forms of the option.
 .TP  .TP
   .B --dumpfile=<path/to/file>
   Specify the location of a pcap-format file which dnsmasq uses to dump copies of network packets for debugging purposes. If the file exists when dnsmasq starts, it is not deleted; new packets are added to the end.
   .TP
   .B --dumpmask=<mask>
   Specify which types of packets should be added to the dumpfile. The argument should be the OR of the bitmasks for each type of packet to be dumped: it can be specified in hex by preceding the number with 0x in  the normal way. Each time a packet is written to the dumpfile, dnsmasq logs the packet sequence and the mask
   representing its type. The current types are: 0x0001 - DNS queries from clients 0x0002 DNS replies to clients 0x0004 - DNS queries to upstream 0x0008 - DNS replies from upstream 0x0010 - queries send upstream for DNSSEC validation 0x0020 - replies to queries for DNSSEC validation 0x0040 - replies to client queries which fail DNSSEC validation 0x0080 replies to queries for DNSSEC validation which fail validation.
   .TP
 .B --add-mac[=base64|text]  .B --add-mac[=base64|text]
 Add the MAC address of the requestor to DNS queries which are  Add the MAC address of the requestor to DNS queries which are
 forwarded upstream. This may be used to DNS filtering by the upstream  forwarded upstream. This may be used to DNS filtering by the upstream
Line 630  subnet as the dnsmasq server. Note that the mechanism  Line 675  subnet as the dnsmasq server. Note that the mechanism 
 is not yet standardised, so this should be considered  is not yet standardised, so this should be considered
 experimental. Also note that exposing MAC addresses in this way may  experimental. Also note that exposing MAC addresses in this way may
 have security and privacy implications. The warning about caching  have security and privacy implications. The warning about caching
given for --add-subnet applies to --add-mac too. An alternative encoding of the given for \fB--add-subnet\fP applies to \fB--add-mac\fP too. An alternative encoding of the
 MAC, as base64, is enabled by adding the "base64" parameter and a human-readable encoding of hex-and-colons is enabled by added the "text" parameter.  MAC, as base64, is enabled by adding the "base64" parameter and a human-readable encoding of hex-and-colons is enabled by added the "text" parameter.
 .TP  .TP
 .B --add-cpe-id=<string>  .B --add-cpe-id=<string>
Add a arbitrary identifying string to o DNS queries which areAdd an arbitrary identifying string to DNS queries which are
 forwarded upstream.  forwarded upstream.
 .TP   .TP 
 .B --add-subnet[[=[<IPv4 address>/]<IPv4 prefix length>][,[<IPv6 address>/]<IPv6 prefix length>]]  .B --add-subnet[[=[<IPv4 address>/]<IPv4 prefix length>][,[<IPv6 address>/]<IPv6 prefix length>]]
Line 647  still marks the request so that no upstream nameserver Line 692  still marks the request so that no upstream nameserver
 address information either. The default is zero for both IPv4 and  address information either. The default is zero for both IPv4 and
 IPv6. Note that upstream nameservers may be configured to return  IPv6. Note that upstream nameservers may be configured to return
 different results based on this information, but the dnsmasq cache  different results based on this information, but the dnsmasq cache
does not take account. If a dnsmasq instance is configured such thatdoes not take account. Caching is therefore disabled for such replies,
different results may be encountered, caching should be disabled.unless the subnet address being added is constant.
   
 For example,  For example,
 .B --add-subnet=24,96  .B --add-subnet=24,96
Line 660  will add 1.2.3.0/24 for both IPv4 and IPv6 requestors. Line 705  will add 1.2.3.0/24 for both IPv4 and IPv6 requestors.
   
 .TP  .TP
 .B \-c, --cache-size=<cachesize>  .B \-c, --cache-size=<cachesize>
Set the size of dnsmasq's cache. The default is 150 names. Setting the cache size to zero disables caching.Set the size of dnsmasq's cache. The default is 150 names. Setting the cache size to zero disables caching. Note: huge cache size impacts performance.
 .TP  .TP
 .B \-N, --no-negcache  .B \-N, --no-negcache
 Disable negative caching. Negative caching allows dnsmasq to remember  Disable negative caching. Negative caching allows dnsmasq to remember
Line 687  permitted to reduce the cache size below the default w Line 732  permitted to reduce the cache size below the default w
 enabled. The nameservers upstream of dnsmasq must be DNSSEC-capable,  enabled. The nameservers upstream of dnsmasq must be DNSSEC-capable,
 ie capable of returning DNSSEC records with data. If they are not,  ie capable of returning DNSSEC records with data. If they are not,
 then dnsmasq will not be able to determine the trusted status of  then dnsmasq will not be able to determine the trusted status of
answers. In the default mode, this menas that all replies will beanswers and this means that DNS service will be entirely broken.
marked as untrusted. If  
.B --dnssec-check-unsigned 
is set and the upstream servers don't support DNSSEC, then DNS service will be entirely broken. 
 .TP  .TP
 .B --trust-anchor=[<class>],<domain>,<key-tag>,<algorithm>,<digest-type>,<digest>  .B --trust-anchor=[<class>],<domain>,<key-tag>,<algorithm>,<digest-type>,<digest>
 Provide DS records to act a trust anchors for DNSSEC  Provide DS records to act a trust anchors for DNSSEC
validation. Typically these will be the DS record(s) for Zone Signingvalidation. Typically these will be the DS record(s) for Key Signing
key(s) of the root zone,key(s) (KSK) of the root zone,
 but trust anchors for limited domains are also possible. The current  but trust anchors for limited domains are also possible. The current
 root-zone trust anchors may be downloaded from https://data.iana.org/root-anchors/root-anchors.xml   root-zone trust anchors may be downloaded from https://data.iana.org/root-anchors/root-anchors.xml 
 .TP  .TP
.B --dnssec-check-unsigned.B --dnssec-check-unsigned[=no]
As a default, dnsmasq does not check that unsigned DNS replies areAs a default, dnsmasq checks that unsigned DNS replies are
legitimate: they are assumed to be valid and passed on (without thelegitimate: this entails possible extra queries even for the majority of DNS
 zones which are not, at the moment, signed. If
 .B --dnssec-check-unsigned=no
 appears in the configuration, then such replies they are assumed to be valid and passed on (without the
 "authentic data" bit set, of course). This does not protect against an  "authentic data" bit set, of course). This does not protect against an
 attacker forging unsigned replies for signed DNS zones, but it is  attacker forging unsigned replies for signed DNS zones, but it is
fast. If this flag is set, dnsmasq will check the zones of unsignedfast.
replies, to ensure that unsigned replies are allowed in those
zones. The cost of this is more upstream queries and slowerVersions of dnsmasq prior to 2.80 defaulted to not checking unsigned replies, and used 
performance. See also the warning about upstream servers in the.B --dnssec-check-unsigned
section on to switch this on. Such configurations will continue to work as before, but those which used the default of no checking will need to be altered to explicitly select no checking. The new default is because switching off checking for unsigned replies is inherently dangerous. Not only does it open the possiblity of forged replies, but it allows everything to appear to be working even when the upstream namesevers do not support DNSSEC, and in this case no DNSSEC validation at all is occurring.
.B --dnssec 
 .TP  .TP
 .B --dnssec-no-timecheck  .B --dnssec-no-timecheck
 DNSSEC signatures are only valid for specified time windows, and should be rejected outside those windows. This generates an  DNSSEC signatures are only valid for specified time windows, and should be rejected outside those windows. This generates an
 interesting chicken-and-egg problem for machines which don't have a hardware real time clock. For these machines to determine the correct   interesting chicken-and-egg problem for machines which don't have a hardware real time clock. For these machines to determine the correct 
 time typically requires use of NTP and therefore DNS, but validating DNS requires that the correct time is already known. Setting this flag  time typically requires use of NTP and therefore DNS, but validating DNS requires that the correct time is already known. Setting this flag
removes the time-window checks (but not other DNSSEC validation.) only until the dnsmasq process receives SIGHUP. The intention isremoves the time-window checks (but not other DNSSEC validation.) only until the dnsmasq process receives SIGINT. The intention is
 that dnsmasq should be started with this flag when the platform determines that reliable time is not currently available. As soon as   that dnsmasq should be started with this flag when the platform determines that reliable time is not currently available. As soon as 
reliable time is established, a SIGHUP should be sent to dnsmasq, which enables time checking, and purges the cache of DNS recordsreliable time is established, a SIGINT should be sent to dnsmasq, which enables time checking, and purges the cache of DNS records
which have not been throughly checked.which have not been thoroughly checked.
 
 Earlier versions of dnsmasq overloaded SIGHUP (which re-reads much configuration) to also enable time validation.
 
 If dnsmasq is run in debug mode (\fB--no-daemon\fP flag) then SIGINT retains its usual meaning of terminating the dnsmasq process.
 .TP  .TP
 .B --dnssec-timestamp=<path>  .B --dnssec-timestamp=<path>
Enables an alternative way of checking the validity of the system time for DNSSEC (see --dnssec-no-timecheck). In this case, the Enables an alternative way of checking the validity of the system time for DNSSEC (see \fB--dnssec-no-timecheck\fP). In this case, the
 system time is considered to be valid once it becomes later than the timestamp on the specified file. The file is created and   system time is considered to be valid once it becomes later than the timestamp on the specified file. The file is created and 
 its timestamp set automatically by dnsmasq. The file must be stored on a persistent filesystem, so that it and its mtime are carried   its timestamp set automatically by dnsmasq. The file must be stored on a persistent filesystem, so that it and its mtime are carried 
 over system restarts. The timestamp file is created after dnsmasq has dropped root, so it must be in a location writable by the   over system restarts. The timestamp file is created after dnsmasq has dropped root, so it must be in a location writable by the 
 unprivileged user that dnsmasq runs as.  unprivileged user that dnsmasq runs as.
 .TP  .TP
 .B --proxy-dnssec  .B --proxy-dnssec
Copy the DNSSEC Authenticated Data bit from upstream servers to downstream clients and cache it.  This is an Copy the DNSSEC Authenticated Data bit from upstream servers to downstream clients.  This is an 
 alternative to having dnsmasq validate DNSSEC, but it depends on the security of the network between   alternative to having dnsmasq validate DNSSEC, but it depends on the security of the network between 
dnsmasq and the upstream servers, and the trustworthiness of the upstream servers.dnsmasq and the upstream servers, and the trustworthiness of the upstream servers. Note that caching the
 Authenticated Data bit correctly in all cases is not technically possible. If the AD bit is to be relied upon
 when using this option, then the cache should be disabled using --cache-size=0. In most cases, enabling DNSSEC validation
 within dnsmasq is a better option. See --dnssec for details.
 .TP  .TP
 .B --dnssec-debug  .B --dnssec-debug
 Set debugging mode for the DNSSEC validation, set the Checking Disabled bit on upstream queries,   Set debugging mode for the DNSSEC validation, set the Checking Disabled bit on upstream queries, 
Line 739  a return code of SERVFAIL. Note that Line 790  a return code of SERVFAIL. Note that
 setting this may affect DNS behaviour in bad ways, it is not an  setting this may affect DNS behaviour in bad ways, it is not an
 extra-logging flag and should not be set in production.  extra-logging flag and should not be set in production.
 .TP  .TP
.B --auth-zone=<domain>[,<subnet>[/<prefix length>][,<subnet>[/<prefix length>].....]].B --auth-zone=<domain>[,<subnet>[/<prefix length>][,<subnet>[/<prefix length>].....][,exclude:<subnet>[/<prefix length>]].....]
 Define a DNS zone for which dnsmasq acts as authoritative server. Locally defined DNS records which are in the domain  Define a DNS zone for which dnsmasq acts as authoritative server. Locally defined DNS records which are in the domain
 will be served. If subnet(s) are given, A and AAAA records must be in one of the  will be served. If subnet(s) are given, A and AAAA records must be in one of the
 specified subnets.  specified subnets.
Line 754  interface addresses may be confined to only IPv6 addre Line 805  interface addresses may be confined to only IPv6 addre
 an interface has dynamically determined global IPv6 addresses which should  an interface has dynamically determined global IPv6 addresses which should
 appear in the zone, but RFC1918 IPv4 addresses which should not.  appear in the zone, but RFC1918 IPv4 addresses which should not.
 Interface-name and address-literal subnet specifications may be used  Interface-name and address-literal subnet specifications may be used
freely in the same --auth-zone declaration.freely in the same \fB--auth-zone\fP declaration.
   
   It's possible to exclude certain IP addresses from responses. It can be
   used, to make sure that answers contain only global routeable IP
   addresses (by excluding loopback, RFC1918 and ULA addresses).
   
 The subnet(s) are also used to define in-addr.arpa and  The subnet(s) are also used to define in-addr.arpa and
 ip6.arpa domains which are served for reverse-DNS queries. If not  ip6.arpa domains which are served for reverse-DNS queries. If not
 specified, the prefix length defaults to 24 for IPv4 and 64 for IPv6.  specified, the prefix length defaults to 24 for IPv4 and 64 for IPv6.
Line 777  authoritative zones as dnsmasq. Line 832  authoritative zones as dnsmasq.
 .B --auth-peer=<ip-address>[,<ip-address>[,<ip-address>...]]  .B --auth-peer=<ip-address>[,<ip-address>[,<ip-address>...]]
 Specify the addresses of secondary servers which are allowed to  Specify the addresses of secondary servers which are allowed to
 initiate zone transfer (AXFR) requests for zones for which dnsmasq is  initiate zone transfer (AXFR) requests for zones for which dnsmasq is
authoritative. If this option is not given, then AXFR requests will beauthoritative. If this option is not given but --auth-sec-servers is,
accepted from any secondary. then AXFR requests will be
 accepted from any secondary. Specifying
 .B --auth-peer
 without
 .B --auth-sec-servers
 enables zone transfer but does not advertise the secondary in NS records returned by dnsmasq.
 .TP   .TP 
 .B --conntrack  .B --conntrack
 Read the Linux connection track mark associated with incoming DNS  Read the Linux connection track mark associated with incoming DNS
Line 788  associated with the queries which cause it, useful for Line 848  associated with the queries which cause it, useful for
 accounting and firewalling. Dnsmasq must have conntrack support  accounting and firewalling. Dnsmasq must have conntrack support
 compiled in and the kernel must have conntrack support  compiled in and the kernel must have conntrack support
 included and configured. This option cannot be combined with  included and configured. This option cannot be combined with
--query-port. .B --query-port.
 .TP  .TP
 .B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>][,<netmask>[,<broadcast>]][,<lease time>]  .B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>][,<netmask>[,<broadcast>]][,<lease time>]
 .TP  .TP
Line 797  included and configured. This option cannot be combine Line 857  included and configured. This option cannot be combine
 Enable the DHCP server. Addresses will be given out from the range  Enable the DHCP server. Addresses will be given out from the range
 <start-addr> to <end-addr> and from statically defined addresses given  <start-addr> to <end-addr> and from statically defined addresses given
 in   in 
.B dhcp-host.B --dhcp-host
 options. If the lease time is given, then leases  options. If the lease time is given, then leases
 will be given for that length of time. The lease time is in seconds,  will be given for that length of time. The lease time is in seconds,
 or minutes (eg 45m) or hours (eg 1h) or "infinite". If not given,  or minutes (eg 45m) or hours (eg 1h) or "infinite". If not given,
the default lease time is one hour. Thethe default lease time is one hour for IPv4 and one day for IPv6. The
 minimum lease time is two minutes. For IPv6 ranges, the lease time  minimum lease time is two minutes. For IPv6 ranges, the lease time
 maybe "deprecated"; this sets the preferred lifetime sent in a DHCP  maybe "deprecated"; this sets the preferred lifetime sent in a DHCP
 lease or router advertisement to zero, which causes clients to use  lease or router advertisement to zero, which causes clients to use
Line 816  agent, dnsmasq cannot determine the netmask itself, so Line 876  agent, dnsmasq cannot determine the netmask itself, so
 specified, otherwise dnsmasq will have to guess, based on the class (A, B or  specified, otherwise dnsmasq will have to guess, based on the class (A, B or
 C) of the network address. The broadcast address is  C) of the network address. The broadcast address is
 always optional. It is always  always optional. It is always
allowed to have more than one dhcp-range in a single subnet. allowed to have more than one \fB--dhcp-range\fP in a single subnet.
   
 For IPv6, the parameters are slightly different: instead of netmask  For IPv6, the parameters are slightly different: instead of netmask
 and broadcast address, there is an optional prefix length which must  and broadcast address, there is an optional prefix length which must
 be equal to or larger then the prefix length on the local interface. If not  be equal to or larger then the prefix length on the local interface. If not
 given, this defaults to 64. Unlike the IPv4 case, the prefix length is not  given, this defaults to 64. Unlike the IPv4 case, the prefix length is not
automatically derived from the interface configuration. The mimimumautomatically derived from the interface configuration. The minimum
 size of the prefix length is 64.  size of the prefix length is 64.
   
 IPv6 (only) supports another type of range. In this, the start address and optional end address contain only the network part (ie ::1) and they are followed by  IPv6 (only) supports another type of range. In this, the start address and optional end address contain only the network part (ie ::1) and they are followed by
Line 840  then deleted. The interface name may have a final "*"  Line 900  then deleted. The interface name may have a final "*" 
 that just any address on eth0 will not do: it must not be an  that just any address on eth0 will not do: it must not be an
 autoconfigured or privacy address, or be deprecated.  autoconfigured or privacy address, or be deprecated.
   
If a dhcp-range is only being used for stateless DHCP and/or SLAAC,If a \fB--dhcp-range\fP is only being used for stateless DHCP and/or SLAAC,
 then the address can be simply ::  then the address can be simply ::
   
 .B --dhcp-range=::,constructor:eth0  .B --dhcp-range=::,constructor:eth0
Line 849  then the address can be simply :: Line 909  then the address can be simply ::
 The optional   The optional 
 .B set:<tag>   .B set:<tag> 
 sets an alphanumeric label which marks this network so that  sets an alphanumeric label which marks this network so that
dhcp options may be specified on a per-network basis. DHCP options may be specified on a per-network basis.
 When it is prefixed with 'tag:' instead, then its meaning changes from setting  When it is prefixed with 'tag:' instead, then its meaning changes from setting
 a tag to matching it. Only one tag may be set, but more than one tag  a tag to matching it. Only one tag may be set, but more than one tag
 may be matched.  may be matched.
Line 859  The optional <mode> keyword may be  Line 919  The optional <mode> keyword may be 
 which tells dnsmasq to enable DHCP for the network specified, but not  which tells dnsmasq to enable DHCP for the network specified, but not
 to dynamically allocate IP addresses: only hosts which have static  to dynamically allocate IP addresses: only hosts which have static
 addresses given via   addresses given via 
.B dhcp-host.B --dhcp-host
 or from /etc/ethers will be served. A static-only subnet with address  or from /etc/ethers will be served. A static-only subnet with address
 all zeros may be used as a "catch-all" address to enable replies to all  all zeros may be used as a "catch-all" address to enable replies to all
 Information-request packets on a subnet which is provided with  Information-request packets on a subnet which is provided with
Line 870  For IPv4, the <mode> may be  Line 930  For IPv4, the <mode> may be 
 .B proxy  .B proxy
 in which case dnsmasq will provide proxy-DHCP on the specified  in which case dnsmasq will provide proxy-DHCP on the specified
 subnet. (See   subnet. (See 
.B pxe-prompt.B --pxe-prompt
 and   and 
.B pxe-service.B --pxe-service
 for details.)  for details.)
   
 For IPv6, the mode may be some combination of  For IPv6, the mode may be some combination of
Line 920  is also included, as described in RFC-3775 section 7.3 Line 980  is also included, as described in RFC-3775 section 7.3
 tells dnsmasq to advertise the prefix without the on-link (aka L) bit set.  tells dnsmasq to advertise the prefix without the on-link (aka L) bit set.
   
 .TP  .TP
.B \-G, --dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore].B \-G, --dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][tag:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
 Specify per host parameters for the DHCP server. This allows a machine  Specify per host parameters for the DHCP server. This allows a machine
 with a particular hardware address to be always allocated the same  with a particular hardware address to be always allocated the same
 hostname, IP address and lease time. A hostname specified like this  hostname, IP address and lease time. A hostname specified like this
Line 938  dnsmasq to always allocate the machine lap the IP addr Line 998  dnsmasq to always allocate the machine lap the IP addr
 192.168.0.199.   192.168.0.199. 
   
 Addresses allocated like this are not constrained to be  Addresses allocated like this are not constrained to be
in the range given by the --dhcp-range option, but they must be inin the range given by the \fB--dhcp-range\fP option, but they must be in
 the same subnet as some valid dhcp-range.  For  the same subnet as some valid dhcp-range.  For
 subnets which don't need a pool of dynamically allocated addresses,  subnets which don't need a pool of dynamically allocated addresses,
use the "static" keyword in the dhcp-range declaration.use the "static" keyword in the \fB--dhcp-range\fP declaration.
   
 It is allowed to use client identifiers (called client  It is allowed to use client identifiers (called client
DUID in IPv6-land rather thanDUID in IPv6-land) rather than
 hardware addresses to identify hosts by prefixing with 'id:'. Thus:   hardware addresses to identify hosts by prefixing with 'id:'. Thus: 
 .B --dhcp-host=id:01:02:03:04,.....   .B --dhcp-host=id:01:02:03:04,..... 
 refers to the host with client identifier 01:02:03:04. It is also  refers to the host with client identifier 01:02:03:04. It is also
Line 952  allowed to specify the client ID as text, like this: Line 1012  allowed to specify the client ID as text, like this:
 .B --dhcp-host=id:clientidastext,.....   .B --dhcp-host=id:clientidastext,..... 
   
 A single  A single
.B dhcp-host .B --dhcp-host
may contain an IPv4 address or an IPv6 address, or both. IPv6 addresses must be bracketed by square brackets thus:may contain an IPv4 address or one or more IPv6 addresses, or both. IPv6 addresses must be bracketed by square brackets thus:
 .B --dhcp-host=laptop,[1234::56]  .B --dhcp-host=laptop,[1234::56]
 IPv6 addresses may contain only the host-identifier part:  IPv6 addresses may contain only the host-identifier part:
 .B --dhcp-host=laptop,[::56]  .B --dhcp-host=laptop,[::56]
in which case they act as wildcards in constructed dhcp ranges, within which case they act as wildcards in constructed DHCP ranges, with
the appropriate network part inserted. the appropriate network part inserted. For IPv6, an address may include a prefix length:
 .B --dhcp-host=laptop,[1234:50/126]
 which (in this case) specifies four addresses, 1234::50 to 1234::53. This (an the ability
 to specify multiple addresses) is useful
 when a host presents either a consistent name or hardware-ID, but varying DUIDs, since it allows
 dnsmasq to honour the static address allocation but assign a different adddress for each DUID. This
 typically occurs when chain netbooting, as each stage of the chain gets in turn allocates an address.
 
 Note that in IPv6 DHCP, the hardware address may not be  Note that in IPv6 DHCP, the hardware address may not be
 available, though it normally is for direct-connected clients, or  available, though it normally is for direct-connected clients, or
 clients using DHCP relays which support RFC 6939.  clients using DHCP relays which support RFC 6939.
Line 973  allocated to a DHCP lease, but only if a  Line 1040  allocated to a DHCP lease, but only if a 
 .B --dhcp-host  .B --dhcp-host
 option specifying the name also exists. Only one hostname can be  option specifying the name also exists. Only one hostname can be
 given in a   given in a 
.B dhcp-host.B --dhcp-host
 option, but aliases are possible by using CNAMEs. (See   option, but aliases are possible by using CNAMEs. (See 
 .B --cname  .B --cname
 ).  ).
Line 988  useful when there is another DHCP server on the networ Line 1055  useful when there is another DHCP server on the networ
 be used by some machines.  be used by some machines.
   
 The set:<tag> construct sets the tag  The set:<tag> construct sets the tag
whenever this dhcp-host directive is in use. This can be used to whenever this \fB--dhcp-host\fP directive is in use. This can be used to
 selectively send DHCP options just for this host. More than one tag  selectively send DHCP options just for this host. More than one tag
can be set in a dhcp-host directive (but not in other places wherecan be set in a \fB--dhcp-host\fP directive (but not in other places where
 "set:<tag>" is allowed). When a host matches any  "set:<tag>" is allowed). When a host matches any
dhcp-host directive (or one implied by /etc/ethers) then the special\fB--dhcp-host\fP directive (or one implied by /etc/ethers) then the special
 tag "known" is set. This allows dnsmasq to be configured to  tag "known" is set. This allows dnsmasq to be configured to
 ignore requests from unknown machines using  ignore requests from unknown machines using
 .B --dhcp-ignore=tag:!known  .B --dhcp-ignore=tag:!known
   If the host matches only a \fB--dhcp-host\fP directive which cannot
   be used because it specifies an address on different subnet, the tag "known-othernet" is set.
   
   The tag:<tag> construct filters which dhcp-host directives are used. Tagged directives are used in preference to untagged ones.
   
 Ethernet addresses (but not client-ids) may have  Ethernet addresses (but not client-ids) may have
 wildcard bytes, so for example   wildcard bytes, so for example 
 .B --dhcp-host=00:20:e0:3b:13:*,ignore   .B --dhcp-host=00:20:e0:3b:13:*,ignore 
Line 1027  has both wired and wireless interfaces. Line 1099  has both wired and wireless interfaces.
 Read DHCP host information from the specified file. If a directory  Read DHCP host information from the specified file. If a directory
 is given, then read all the files contained in that directory. The file contains   is given, then read all the files contained in that directory. The file contains 
 information about one host per line. The format of a line is the same  information about one host per line. The format of a line is the same
as text to the right of '=' in --dhcp-host. The advantage of storing DHCP host informationas text to the right of '=' in \fB--dhcp-host\fP. The advantage of storing DHCP host information
 in this file is that it can be changed without re-starting dnsmasq:  in this file is that it can be changed without re-starting dnsmasq:
 the file will be re-read when dnsmasq receives SIGHUP.  the file will be re-read when dnsmasq receives SIGHUP.
 .TP  .TP
 .B --dhcp-optsfile=<path>  .B --dhcp-optsfile=<path>
 Read DHCP option information from the specified file.  If a directory  Read DHCP option information from the specified file.  If a directory
 is given, then read all the files contained in that directory. The advantage of   is given, then read all the files contained in that directory. The advantage of 
using this option is the same as for --dhcp-hostsfile: theusing this option is the same as for \fB--dhcp-hostsfile\fP: the
dhcp-optsfile will be re-read when dnsmasq receives SIGHUP. Note that\fB--dhcp-optsfile\fP will be re-read when dnsmasq receives SIGHUP. Note that
 it is possible to encode the information in a  it is possible to encode the information in a
   .B --dhcp-boot
   flag as DHCP options, using the options names bootfile-name,
   server-ip-address and tftp-server. This allows these to be included
   in a \fB--dhcp-optsfile\fP.
 .TP  .TP
 .B --dhcp-hostsdir=<path>  .B --dhcp-hostsdir=<path>
This is equivalent to dhcp-hostsfile, except for the following. The path MUST be aThis is equivalent to \fB--dhcp-hostsfile\fP, except for the following. The path MUST be a
 directory, and not an individual file. Changed or new files within  directory, and not an individual file. Changed or new files within
 the directory are read automatically, without the need to send SIGHUP.  the directory are read automatically, without the need to send SIGHUP.
If a file is deleted for changed after it has been read by dnsmasq, then theIf a file is deleted or changed after it has been read by dnsmasq, then the
host record it contained will remain until dnsmasq recieves a SIGHUP, or host record it contained will remain until dnsmasq receives a SIGHUP, or 
 is restarted; ie host records are only added dynamically.  is restarted; ie host records are only added dynamically.
 .TP  .TP
 .B --dhcp-optsdir=<path>  .B --dhcp-optsdir=<path>
This is equivalent to dhcp-optsfile, with the differences noted for --dhcp-hostsdir.This is equivalent to \fB--dhcp-optsfile\fP, with the differences noted for \fB--dhcp-hostsdir\fP.
.TP 
.B --dhcp-boot 
flag as DHCP options, using the options names bootfile-name, 
server-ip-address and tftp-server. This allows these to be included 
in a dhcp-optsfile. 
 .TP   .TP 
 .B \-Z, --read-ethers  .B \-Z, --read-ethers
 Read /etc/ethers for information about hosts for the DHCP server. The  Read /etc/ethers for information about hosts for the DHCP server. The
Line 1123  a literal IP address as TFTP server name, it is necess Line 1194  a literal IP address as TFTP server name, it is necess
 .B --dhcp-option=66,"1.2.3.4"  .B --dhcp-option=66,"1.2.3.4"
   
 Encapsulated Vendor-class options may also be specified (IPv4 only) using  Encapsulated Vendor-class options may also be specified (IPv4 only) using
--dhcp-option: for instance \fB--dhcp-option\fP: for instance
 .B --dhcp-option=vendor:PXEClient,1,0.0.0.0   .B --dhcp-option=vendor:PXEClient,1,0.0.0.0 
 sends the encapsulated vendor  sends the encapsulated vendor
 class-specific option "mftp-address=0.0.0.0" to any client whose  class-specific option "mftp-address=0.0.0.0" to any client whose
 vendor-class matches "PXEClient". The vendor-class matching is  vendor-class matches "PXEClient". The vendor-class matching is
substring based (see --dhcp-vendorclass for details). If asubstring based (see \fB--dhcp-vendorclass\fP for details). If a
 vendor-class option (number 60) is sent by dnsmasq, then that is used   vendor-class option (number 60) is sent by dnsmasq, then that is used 
 for selecting encapsulated options in preference to any sent by the  for selecting encapsulated options in preference to any sent by the
 client. It is  client. It is
Line 1141  Options may be encapsulated (IPv4 only) within other o Line 1212  Options may be encapsulated (IPv4 only) within other o
 will send option 175, within which is the option 190. If multiple  will send option 175, within which is the option 190. If multiple
 options are given which are encapsulated with the same option number  options are given which are encapsulated with the same option number
 then they will be correctly combined into one encapsulated option.  then they will be correctly combined into one encapsulated option.
encap: and vendor: are may not both be set in the same dhcp-option.encap: and vendor: are may not both be set in the same \fB--dhcp-option\fP.
   
 The final variant on encapsulated options is "Vendor-Identifying  The final variant on encapsulated options is "Vendor-Identifying
 Vendor Options" as specified by RFC3925. These are denoted like this:   Vendor Options" as specified by RFC3925. These are denoted like this: 
Line 1163  needed, for example when sending options to PXELinux. Line 1234  needed, for example when sending options to PXELinux.
 .B --dhcp-no-override  .B --dhcp-no-override
 (IPv4 only) Disable re-use of the DHCP servername and filename fields as extra  (IPv4 only) Disable re-use of the DHCP servername and filename fields as extra
 option space. If it can, dnsmasq moves the boot server and filename  option space. If it can, dnsmasq moves the boot server and filename
information (from dhcp-boot) out of their dedicated fields intoinformation (from \fB--dhcp-boot\fP) out of their dedicated fields into
 DHCP options. This make extra space available in the DHCP packet for  DHCP options. This make extra space available in the DHCP packet for
 options but can, rarely, confuse old or broken clients. This flag  options but can, rarely, confuse old or broken clients. This flag
 forces "simple and safe" behaviour to avoid problems in such a case.  forces "simple and safe" behaviour to avoid problems in such a case.
Line 1173  Configure dnsmasq to do DHCP relay. The local address  Line 1244  Configure dnsmasq to do DHCP relay. The local address 
 allocated to an interface on the host running dnsmasq. All DHCP  allocated to an interface on the host running dnsmasq. All DHCP
 requests arriving on that interface will we relayed to a remote DHCP  requests arriving on that interface will we relayed to a remote DHCP
 server at the server address. It is possible to relay from a single local  server at the server address. It is possible to relay from a single local
address to multiple remote servers by using multiple dhcp-relayaddress to multiple remote servers by using multiple \fB--dhcp-relay\fP
 configs with the same local address and different server  configs with the same local address and different server
 addresses. A server address must be an IP literal address, not a  addresses. A server address must be an IP literal address, not a
 domain name. In the case of DHCPv6, the server address may be the  domain name. In the case of DHCPv6, the server address may be the
Line 1182  must be given, not be wildcard, and is used to direct  Line 1253  must be given, not be wildcard, and is used to direct 
 correct interface to reach the DHCP server.   correct interface to reach the DHCP server. 
   
 Access control for DHCP clients has the same rules as for the DHCP  Access control for DHCP clients has the same rules as for the DHCP
server, see --interface, --except-interface, etc. The optionalserver, see \fB--interface\fP, \fB--except-interface\fP, etc. The optional
interface name in the dhcp-relay config has a different function: itinterface name in the \fB--dhcp-relay\fP config has a different function: it
 controls on which interface DHCP replies from the server will be  controls on which interface DHCP replies from the server will be
 accepted. This is intended for configurations which have three  accepted. This is intended for configurations which have three
 interfaces: one being relayed from, a second connecting the DHCP  interfaces: one being relayed from, a second connecting the DHCP
Line 1205  Map from a vendor-class string to a tag. Most DHCP cli Line 1276  Map from a vendor-class string to a tag. Most DHCP cli
 "vendor class" which represents, in some sense, the type of host. This option   "vendor class" which represents, in some sense, the type of host. This option 
 maps vendor classes to tags, so that DHCP options may be selectively delivered  maps vendor classes to tags, so that DHCP options may be selectively delivered
 to different classes of hosts. For example   to different classes of hosts. For example 
.B dhcp-vendorclass=set:printers,Hewlett-Packard JetDirect.B --dhcp-vendorclass=set:printers,Hewlett-Packard JetDirect
 will allow options to be set only for HP printers like so:  will allow options to be set only for HP printers like so:
 .B --dhcp-option=tag:printers,3,192.168.4.4   .B --dhcp-option=tag:printers,3,192.168.4.4 
 The vendor-class string is  The vendor-class string is
Line 1240  normally given as colon-separated hex, but is also all Line 1311  normally given as colon-separated hex, but is also all
 simple string. If an exact match is achieved between the circuit or  simple string. If an exact match is achieved between the circuit or
 agent ID and one provided by a relay agent, the tag is set.   agent ID and one provided by a relay agent, the tag is set. 
   
.B dhcp-remoteid.B --dhcp-remoteid
(but not dhcp-circuitid) is supported in IPv6. (but not \fB--dhcp-circuitid\fP) is supported in IPv6.
 .TP  .TP
 .B --dhcp-subscrid=set:<tag>,<subscriber-id>  .B --dhcp-subscrid=set:<tag>,<subscriber-id>
 (IPv4 and IPv6) Map from RFC3993 subscriber-id relay agent options to tags.  (IPv4 and IPv6) Map from RFC3993 subscriber-id relay agent options to tags.
Line 1252  a DHCP interaction to the DHCP server. Once a client i Line 1323  a DHCP interaction to the DHCP server. Once a client i
 communicates directly with the server. This is undesirable if the  communicates directly with the server. This is undesirable if the
 relay agent is adding extra information to the DHCP packets, such as  relay agent is adding extra information to the DHCP packets, such as
 that used by  that used by
.B dhcp-circuitid.B --dhcp-circuitid
 and  and
.B dhcp-remoteid..B --dhcp-remoteid.
 A full relay implementation can use the RFC 5107 serverid-override  A full relay implementation can use the RFC 5107 serverid-override
 option to force the DHCP server to use the relay as a full proxy, with all  option to force the DHCP server to use the relay as a full proxy, with all
 packets passing through it. This flag provides an alternative method  packets passing through it. This flag provides an alternative method
Line 1270  the option is sent and matches the value. The value ma Line 1341  the option is sent and matches the value. The value ma
 "01:ff:*:02" in which case the value must match (apart from wildcards)  "01:ff:*:02" in which case the value must match (apart from wildcards)
 but the option sent may have unmatched data past the end of the  but the option sent may have unmatched data past the end of the
 value. The value may also be of the same form as in   value. The value may also be of the same form as in 
.B dhcp-option.B --dhcp-option
 in which case the option sent is treated as an array, and one element  in which case the option sent is treated as an array, and one element
 must match, so  must match, so
.B --dhcp-match=set:efi-ia32,option:client-arch,6
--dhcp-match=set:efi-ia32,option:client-arch,6 
 
 will set the tag "efi-ia32" if the the number 6 appears in the list of  will set the tag "efi-ia32" if the the number 6 appears in the list of
 architectures sent by the client in option 93. (See RFC 4578 for  architectures sent by the client in option 93. (See RFC 4578 for
 details.)  If the value is a string, substring matching is used.  details.)  If the value is a string, substring matching is used.
Line 1284  The special form with vi-encap:<enterprise number> mat Line 1353  The special form with vi-encap:<enterprise number> mat
 vendor-identifying vendor classes for the specified enterprise. Please  vendor-identifying vendor classes for the specified enterprise. Please
 see RFC 3925 for more details of these rare and interesting beasts.  see RFC 3925 for more details of these rare and interesting beasts.
 .TP  .TP
   .B --dhcp-name-match=set:<tag>,<name>[*]
   Set the tag if the given name is supplied by a DHCP client. There may be a single trailing wildcard *, which has the usual meaning. Combined with dhcp-ignore or dhcp-ignore-names this gives the ability to ignore certain clients by name, or disallow certain hostnames from being claimed by a client.
   .TP
 .B --tag-if=set:<tag>[,set:<tag>[,tag:<tag>[,tag:<tag>]]]  .B --tag-if=set:<tag>[,set:<tag>[,tag:<tag>[,tag:<tag>]]]
 Perform boolean operations on tags. Any tag appearing as set:<tag> is set if  Perform boolean operations on tags. Any tag appearing as set:<tag> is set if
 all the tags which appear as tag:<tag> are set, (or unset when tag:!<tag> is used)  all the tags which appear as tag:<tag> are set, (or unset when tag:!<tag> is used)
 If no tag:<tag> appears set:<tag> tags are set unconditionally.  If no tag:<tag> appears set:<tag> tags are set unconditionally.
 Any number of set: and tag: forms may appear, in any order.   Any number of set: and tag: forms may appear, in any order. 
Tag-if lines ares executed in order, so if the tag in tag:<tag> is a\fB--tag-if\fP lines are executed in order, so if the tag in tag:<tag> is a
 tag set by another  tag set by another
.B tag-if,.B --tag-if,
 the line which sets the tag must precede the one which tests it.  the line which sets the tag must precede the one which tests it.
 .TP  .TP
 .B \-J, --dhcp-ignore=tag:<tag>[,tag:<tag>]  .B \-J, --dhcp-ignore=tag:<tag>[,tag:<tag>]
Line 1300  not allocate it a DHCP lease. Line 1372  not allocate it a DHCP lease.
 .TP  .TP
 .B --dhcp-ignore-names[=tag:<tag>[,tag:<tag>]]  .B --dhcp-ignore-names[=tag:<tag>[,tag:<tag>]]
 When all the given tags appear in the tag set, ignore any hostname  When all the given tags appear in the tag set, ignore any hostname
provided by the host. Note that, unlike dhcp-ignore, it is permissibleprovided by the host. Note that, unlike \fB--dhcp-ignore\fP, it is permissible
 to supply no tags, in which case DHCP-client supplied hostnames  to supply no tags, in which case DHCP-client supplied hostnames
 are always ignored, and DHCP hosts are added to the DNS using only  are always ignored, and DHCP hosts are added to the DNS using only
dhcp-host configuration in dnsmasq and the contents of /etc/hosts and\fB--dhcp-host\fP configuration in dnsmasq and the contents of /etc/hosts and
 /etc/ethers.  /etc/ethers.
 .TP  .TP
 .B --dhcp-generate-names=tag:<tag>[,tag:<tag>]  .B --dhcp-generate-names=tag:<tag>[,tag:<tag>]
Line 1348  address, and setting this flag enables this mode. Note Line 1420  address, and setting this flag enables this mode. Note
 sequential mode, clients which allow a lease to expire are much more  sequential mode, clients which allow a lease to expire are much more
 likely to move IP address; for this reason it should not be generally used.  likely to move IP address; for this reason it should not be generally used.
 .TP  .TP
   .B --dhcp-ignore-clid
   Dnsmasq is reading 'client identifier' (RFC 2131) option sent by clients
   (if available) to identify clients. This allow to serve same IP address
   for a host using several interfaces. Use this option to disable 'client identifier'
   reading, i.e. to always identify a host using the MAC address.
   .TP
 .B --pxe-service=[tag:<tag>,]<CSA>,<menu text>[,<basename>|<bootservicetype>][,<server address>|<server_name>]  .B --pxe-service=[tag:<tag>,]<CSA>,<menu text>[,<basename>|<bootservicetype>][,<server address>|<server_name>]
 Most uses of PXE boot-ROMS simply allow the PXE  Most uses of PXE boot-ROMS simply allow the PXE
 system to obtain an IP address and then download the file specified by  system to obtain an IP address and then download the file specified by
.B dhcp-boot.B --dhcp-boot
 and execute it. However the PXE system is capable of more complex  and execute it. However the PXE system is capable of more complex
 functions when supported by a suitable DHCP server.  functions when supported by a suitable DHCP server.
   
Line 1363  integer may be used for other types. The Line 1441  integer may be used for other types. The
 parameter after the menu text may be a file name, in which case dnsmasq acts as a  parameter after the menu text may be a file name, in which case dnsmasq acts as a
 boot server and directs the PXE client to download the file by TFTP,  boot server and directs the PXE client to download the file by TFTP,
 either from itself (  either from itself (
.B enable-tftp .B --enable-tftp
 must be set for this to work) or another TFTP server if the final server  must be set for this to work) or another TFTP server if the final server
 address/name is given.  address/name is given.
 Note that the "layer"  Note that the "layer"
Line 1385  timeout is given then after the Line 1463  timeout is given then after the
 timeout has elapsed with no keyboard input, the first available menu  timeout has elapsed with no keyboard input, the first available menu
 option will be automatically executed. If the timeout is zero then the first available menu  option will be automatically executed. If the timeout is zero then the first available menu
 item will be executed immediately. If   item will be executed immediately. If 
.B pxe-prompt.B --pxe-prompt
 is omitted the system will wait for user input if there are multiple  is omitted the system will wait for user input if there are multiple
 items in the menu, but boot immediately if  items in the menu, but boot immediately if
 there is only one. See  there is only one. See
.B pxe-service .B --pxe-service
 for details of menu items.  for details of menu items.
   
 Dnsmasq supports PXE "proxy-DHCP", in this case another DHCP server on  Dnsmasq supports PXE "proxy-DHCP", in this case another DHCP server on
 the network is responsible for allocating IP addresses, and dnsmasq  the network is responsible for allocating IP addresses, and dnsmasq
 simply provides the information given in   simply provides the information given in 
.B pxe-prompt.B --pxe-prompt
 and  and
.B pxe-service.B --pxe-service
 to allow netbooting. This mode is enabled using the  to allow netbooting. This mode is enabled using the
 .B proxy  .B proxy
 keyword in  keyword in
.B dhcp-range..B --dhcp-range.
 .TP
 .B --dhcp-pxe-vendor=<vendor>[,...]
 According to UEFI and PXE specifications, DHCP packets between PXE clients and
 proxy PXE servers should have 
 .I PXEClient 
 in their vendor-class field. However, the firmware of computers from a few
 vendors is customized to carry a different identifier in that field. This option
 is used to consider such identifiers valid for identifying PXE clients. For 
 instance
 
 .B --dhcp-pxe-vendor=PXEClient,HW-Client
 
 will enable dnsmasq to also provide proxy PXE service to those PXE clients with
 .I HW-Client
 in as their identifier.
 >>>>>>> 907def3... pxe: support pxe clients with custom vendor-class
 .TP    .TP  
 .B \-X, --dhcp-lease-max=<number>  .B \-X, --dhcp-lease-max=<number>
 Limits dnsmasq to the specified maximum number of DHCP leases. The  Limits dnsmasq to the specified maximum number of DHCP leases. The
Line 1418  allows dnsmasq to rebuild its lease database without e Line 1512  allows dnsmasq to rebuild its lease database without e
 reacquire a lease, if the database is lost. For DHCPv6 it sets the  reacquire a lease, if the database is lost. For DHCPv6 it sets the
 priority in replies to 255 (the maximum) instead of 0 (the minimum).  priority in replies to 255 (the maximum) instead of 0 (the minimum).
 .TP  .TP
   .B --dhcp-rapid-commit
   Enable DHCPv4 Rapid Commit Option specified in RFC 4039. When enabled, dnsmasq
   will respond to a DHCPDISCOVER message including a Rapid Commit
   option with a DHCPACK including a Rapid Commit option and fully committed
   address and configuration information. Should only be enabled if either the
   server is  the only server for the subnet, or multiple servers are present and they each commit a binding for all clients.
   .TP
 .B --dhcp-alternate-port[=<server port>[,<client port>]]  .B --dhcp-alternate-port[=<server port>[,<client port>]]
 (IPv4 only) Change the ports used for DHCP from the default. If this option is  (IPv4 only) Change the ports used for DHCP from the default. If this option is
 given alone, without arguments, it changes the ports used for DHCP  given alone, without arguments, it changes the ports used for DHCP
Line 1447  the tags used to determine them. Line 1548  the tags used to determine them.
 .TP  .TP
 .B --quiet-dhcp, --quiet-dhcp6, --quiet-ra  .B --quiet-dhcp, --quiet-dhcp6, --quiet-ra
 Suppress logging of the routine operation of these protocols. Errors and  Suppress logging of the routine operation of these protocols. Errors and
problems will still be logged. --quiet-dhcp and quiet-dhcp6 areproblems will still be logged. \fB--quiet-dhcp\fP and quiet-dhcp6 are
over-ridden by --log-dhcp.over-ridden by \fB--log-dhcp\fP.
 .TP  .TP
 .B \-l, --dhcp-leasefile=<path>  .B \-l, --dhcp-leasefile=<path>
 Use the specified file to store DHCP lease information.  Use the specified file to store DHCP lease information.
Line 1460  DUID automatically when it is first needed. When given Line 1561  DUID automatically when it is first needed. When given
 provides dnsmasq the data required to create a DUID-EN type DUID. Note  provides dnsmasq the data required to create a DUID-EN type DUID. Note
 that once set, the DUID is stored in the lease database, so to change between DUID-EN and  that once set, the DUID is stored in the lease database, so to change between DUID-EN and
 automatically created DUIDs or vice-versa, the lease database must be  automatically created DUIDs or vice-versa, the lease database must be
re-intialised. The enterprise-id is assigned by IANA, and the uid is are-initialised. The enterprise-id is assigned by IANA, and the uid is a
 string of hex octets unique to a particular device.  string of hex octets unique to a particular device.
 .TP  .TP
 .B \-6 --dhcp-script=<path>  .B \-6 --dhcp-script=<path>
Line 1474  address of the host (or DUID for IPv6) , the IP addres Line 1575  address of the host (or DUID for IPv6) , the IP addres
 if known. "add" means a lease has been created, "del" means it has  if known. "add" means a lease has been created, "del" means it has
 been destroyed, "old" is a notification of an existing lease when  been destroyed, "old" is a notification of an existing lease when
 dnsmasq starts or a change to MAC address or hostname of an existing  dnsmasq starts or a change to MAC address or hostname of an existing
lease (also, lease length or expiry and client-id, if leasefile-ro is set).lease (also, lease length or expiry and client-id, if \fB--leasefile-ro\fP is set
 and lease expiry if \fB--script-on-renewal\fP is set).
 If the MAC address is from a network type other than ethernet,  If the MAC address is from a network type other than ethernet,
 it will have the network type prepended, eg "06-01:23:45:67:89:ab" for  it will have the network type prepended, eg "06-01:23:45:67:89:ab" for
 token ring. The process is run as root (assuming that dnsmasq was originally run as  token ring. The process is run as root (assuming that dnsmasq was originally run as
Line 1528  DHCP relay-agent added any of these options. Line 1630  DHCP relay-agent added any of these options.
     
 If the client provides vendor-class, DNSMASQ_VENDOR_CLASS.  If the client provides vendor-class, DNSMASQ_VENDOR_CLASS.
   
   DNSMASQ_REQUESTED_OPTIONS a string containing the decimal values in the Parameter Request List option, comma separated, if the parameter request list option is provided by the client.
   
 For IPv6 only:  For IPv6 only:
   
 If the client provides vendor-class, DNSMASQ_VENDOR_CLASS_ID,  If the client provides vendor-class, DNSMASQ_VENDOR_CLASS_ID,
Line 1551  database. Line 1655  database.
   
   
 All file descriptors are  All file descriptors are
closed except stdin, stdout and stderr which are open to /dev/nullclosed except stdin, which is open to /dev/null, and stdout and stderr which capture output for logging by dnsmasq. 
(except in debug mode).(In debug mode, stdio, stdout and stderr file are left as those inherited from the invoker of dnsmasq).
   
 The script is not invoked concurrently: at most one instance  The script is not invoked concurrently: at most one instance
 of the script is ever running (dnsmasq waits for an instance of script to exit  of the script is ever running (dnsmasq waits for an instance of script to exit
Line 1588  the arrival of a new entry in the ARP or neighbour tab Line 1692  the arrival of a new entry in the ARP or neighbour tab
 .B --dhcp-luascript=<path>  .B --dhcp-luascript=<path>
 Specify a script written in Lua, to be run when leases are created,  Specify a script written in Lua, to be run when leases are created,
 destroyed or changed. To use this option, dnsmasq must be compiled  destroyed or changed. To use this option, dnsmasq must be compiled
with the correct support. The Lua interpreter is intialised once, whenwith the correct support. The Lua interpreter is initialised once, when
 dnsmasq starts, so that global variables persist between lease  dnsmasq starts, so that global variables persist between lease
 events. The Lua code must define a  events. The Lua code must define a
 .B lease  .B lease
Line 1638  and Line 1742  and
 functions are called only when enabled with  functions are called only when enabled with
 .B --script-arp  .B --script-arp
 and have a table which holds the tags  and have a table which holds the tags
.B mac_addres.B mac_address
 and  and
 .B client_address.  .B client_address.
 .TP  .TP
Line 1646  and Line 1750  and
 Specify the user as which to run the lease-change script or Lua script. This defaults to root, but can be changed to another user using this flag.   Specify the user as which to run the lease-change script or Lua script. This defaults to root, but can be changed to another user using this flag. 
 .TP  .TP
 .B --script-arp  .B --script-arp
Enable the "arp" and "arp-old" functions in the dhcp-script and dhcp-luascript.Enable the "arp" and "arp-old" functions in the \fB--dhcp-script\fP and \fB--dhcp-luascript\fP.
 .TP  .TP
 .B \-9, --leasefile-ro  .B \-9, --leasefile-ro
 Completely suppress use of the lease database file. The file will not  Completely suppress use of the lease database file. The file will not
Line 1662  stdout and exit with zero exit code. Setting this Line 1766  stdout and exit with zero exit code. Setting this
 option also forces the leasechange script to be called on changes  option also forces the leasechange script to be called on changes
 to the client-id and lease length and expiry time.  to the client-id and lease length and expiry time.
 .TP  .TP
   .B --script-on-renewal
   Call the DHCP script when the lease expiry time changes, for instance when the
   lease is renewed.
   .TP
 .B --bridge-interface=<interface>,<alias>[,<alias>]  .B --bridge-interface=<interface>,<alias>[,<alias>]
Treat DHCP (v4 and v6) request and IPv6 Router Solicit packetsTreat DHCP (v4 and v6) requests and IPv6 Router Solicit packets
 arriving at any of the <alias> interfaces as if they had arrived at  arriving at any of the <alias> interfaces as if they had arrived at
 <interface>.  This option allows dnsmasq to provide DHCP and RA  <interface>.  This option allows dnsmasq to provide DHCP and RA
 service over unaddressed and unbridged Ethernet interfaces, e.g. on an  service over unaddressed and unbridged Ethernet interfaces, e.g. on an
 OpenStack compute host where each such interface is a TAP interface to  OpenStack compute host where each such interface is a TAP interface to
 a VM, or as in "old style bridging" on BSD platforms.  A trailing '*'  a VM, or as in "old style bridging" on BSD platforms.  A trailing '*'
 wildcard can be used in each <alias>.  wildcard can be used in each <alias>.
   
   It is permissible to add more than one alias using more than one \fB--bridge-interface\fP option since
   \fB--bridge-interface=int1,alias1,alias2\fP is exactly equivalent to
   \fB--bridge-interface=int1,alias1 --bridge-interface=int1,alias2\fP
 .TP  .TP
   .B --shared-network=<interface>,<addr>
   .PD 0
   .TP
   .B --shared-network=<addr>,<addr>
   .PD 1v
   The DHCP server determines which DHCP ranges are useable for allocating an
   address to a DHCP client based on the network from which the DHCP request arrives,
   and the IP configuration of the server's interface on that network. The shared-network
   option extends the available subnets (and therefore DHCP ranges) beyond the
   subnets configured on the arrival interface.
   
   The first argument is either the
   name of an interface, or an address that is configured on a local interface, and the
   second argument is an address which defines another subnet on which addresses can be allocated.
   
   To be useful, there must be a suitable dhcp-range which allows address allocation on this subnet
   and this dhcp-range MUST include the netmask.
   
   Using shared-network also needs extra
   consideration of routing. Dnsmasq does not have the usual information that it uses to
   determine the default route, so the default route option (or other routing) MUST be
   configured manually. The client must have a route to the server: if the two-address form
   of shared-network is used, this needs to be to the first specified address. If the interface,address
   form is used, there must be a route to all of the addresses configured on the interface.
   
   The two-address form of shared-network is also usable with a DHCP relay: the first address
   is the address of the relay and the second, as before, specifies an extra subnet which
   addresses may be allocated from.
   
   .TP
 .B \-s, --domain=<domain>[,<address range>[,local]]  .B \-s, --domain=<domain>[,<address range>[,local]]
 Specifies DNS domains for the DHCP server. Domains may be be given   Specifies DNS domains for the DHCP server. Domains may be be given 
 unconditionally (without the IP range) or for limited IP ranges. This has two effects;  unconditionally (without the IP range) or for limited IP ranges. This has two effects;
Line 1678  firstly it causes the DHCP server to return the domain Line 1820  firstly it causes the DHCP server to return the domain
 which request it, and secondly it sets the domain which it is legal  which request it, and secondly it sets the domain which it is legal
 for DHCP-configured hosts to claim. The intention is to constrain  for DHCP-configured hosts to claim. The intention is to constrain
 hostnames so that an untrusted host on the LAN cannot advertise   hostnames so that an untrusted host on the LAN cannot advertise 
its name via dhcp as e.g. "microsoft.com" and capture traffic not its name via DHCP as e.g. "microsoft.com" and capture traffic not 
 meant for it. If no domain suffix is specified, then any DHCP  meant for it. If no domain suffix is specified, then any DHCP
 hostname with a domain part (ie with a period) will be disallowed   hostname with a domain part (ie with a period) will be disallowed 
 and logged. If suffix is specified, then hostnames with a domain   and logged. If suffix is specified, then hostnames with a domain 
Line 1700  which can change the behaviour of dnsmasq with domains Line 1842  which can change the behaviour of dnsmasq with domains
   
 If the address range is given as ip-address/network-size, then a  If the address range is given as ip-address/network-size, then a
 additional flag "local" may be supplied which has the effect of adding  additional flag "local" may be supplied which has the effect of adding
--local declarations for forward and reverse DNS queries. Eg.\fB--local\fP declarations for forward and reverse DNS queries. Eg.
 .B --domain=thekelleys.org.uk,192.168.0.0/24,local  .B --domain=thekelleys.org.uk,192.168.0.0/24,local
 is identical to  is identical to
 .B --domain=thekelleys.org.uk,192.168.0.0/24  .B --domain=thekelleys.org.uk,192.168.0.0/24
--local=/thekelleys.org.uk/ --local=/0.168.192.in-addr.arpa/.B --local=/thekelleys.org.uk/ --local=/0.168.192.in-addr.arpa/
 The network size must be 8, 16 or 24 for this to be legal.  The network size must be 8, 16 or 24 for this to be legal.
 .TP  .TP
 .B --dhcp-fqdn  .B --dhcp-fqdn
Line 1739  discovery and (possibly) prefix discovery for autonomo Line 1881  discovery and (possibly) prefix discovery for autonomo
 creation are handled by a different protocol. When DHCP is in use,  creation are handled by a different protocol. When DHCP is in use,
 only a subset of this is needed, and dnsmasq can handle it, using  only a subset of this is needed, and dnsmasq can handle it, using
 existing DHCP configuration to provide most data. When RA is enabled,  existing DHCP configuration to provide most data. When RA is enabled,
dnsmasq will advertise a prefix for each dhcp-range, with defaultdnsmasq will advertise a prefix for each \fB--dhcp-range\fP, with default
 router  as the relevant link-local address on   router  as the relevant link-local address on 
 the machine running dnsmasq. By default, the "managed address" bits are set, and  the machine running dnsmasq. By default, the "managed address" bits are set, and
 the "use SLAAC" bit is reset. This can be changed for individual  the "use SLAAC" bit is reset. This can be changed for individual
Line 1748  subnets with the mode keywords described in Line 1890  subnets with the mode keywords described in
 RFC6106 DNS parameters are included in the advertisements. By default,  RFC6106 DNS parameters are included in the advertisements. By default,
 the relevant link-local address of the machine running dnsmasq is sent  the relevant link-local address of the machine running dnsmasq is sent
 as recursive DNS server. If provided, the DHCPv6 options dns-server and  as recursive DNS server. If provided, the DHCPv6 options dns-server and
domain-search are used for the DNS server (RDNSS) and the domain serach list (DNSSL).domain-search are used for the DNS server (RDNSS) and the domain search list (DNSSL).
 .TP  .TP
.B --ra-param=<interface>,[high|low],[[<ra-interval>],<router lifetime>].B --ra-param=<interface>,[mtu:<integer>|<interface>|off,][high,|low,]<ra-interval>[,<router lifetime>]
 Set non-default values for router advertisements sent via an  Set non-default values for router advertisements sent via an
 interface. The priority field for the router may be altered from the  interface. The priority field for the router may be altered from the
 default of medium with eg  default of medium with eg
Line 1759  The interval between router advertisements may be set  Line 1901  The interval between router advertisements may be set 
 .B --ra-param=eth0,60.  .B --ra-param=eth0,60.
 The lifetime of the route may be changed or set to zero, which allows  The lifetime of the route may be changed or set to zero, which allows
 a router to advertise prefixes but not a route via itself.   a router to advertise prefixes but not a route via itself. 
.B --ra-parm=eth0,0,0.B --ra-param=eth0,0,0
(A value of zero for the interval means the default value.) All three parameters may be set at once.(A value of zero for the interval means the default value.) All four parameters may be set at once.
.B --ra-param=low,60,1200.B --ra-param=eth0,mtu:1280,low,60,1200
 
 The interface field may include a wildcard.  The interface field may include a wildcard.
   
   The mtu: parameter may be an arbitrary interface name, in which case the MTU value for that interface is used. This is useful
   for (eg) advertising the MTU of a WAN interface on the other interfaces of a router.
 .TP  .TP
   .B --dhcp-reply-delay=[tag:<tag>,]<integer>
   Delays sending DHCPOFFER and PROXYDHCP replies for at least the specified number of seconds.
   This can be used as workaround for bugs in PXE boot firmware that does not function properly when
   receiving an instant reply.
   This option takes into account the time already spent waiting (e.g. performing ping check) if any.
   .TP
 .B --enable-tftp[=<interface>[,<interface>]]  .B --enable-tftp[=<interface>[,<interface>]]
 Enable the TFTP server function. This is deliberately limited to that  Enable the TFTP server function. This is deliberately limited to that
 needed to net-boot a client. Only reading is allowed; the tsize and  needed to net-boot a client. Only reading is allowed; the tsize and
 blksize extensions are supported (tsize is only supported in octet  blksize extensions are supported (tsize is only supported in octet
 mode). Without an argument, the TFTP service is provided to the same set of interfaces as DHCP service.   mode). Without an argument, the TFTP service is provided to the same set of interfaces as DHCP service. 
If the list of interfaces is provided, that defines which interfaces recieve TFTP service.If the list of interfaces is provided, that defines which interfaces receive TFTP service.
 .TP  .TP
 .B --tftp-root=<directory>[,<interface>]  .B --tftp-root=<directory>[,<interface>]
 Look for files to transfer using TFTP relative to the given  Look for files to transfer using TFTP relative to the given
Line 1782  directory is only used for TFTP requests via that inte Line 1934  directory is only used for TFTP requests via that inte
 .B --tftp-no-fail  .B --tftp-no-fail
 Do not abort startup if specified tftp root directories are inaccessible.  Do not abort startup if specified tftp root directories are inaccessible.
 .TP  .TP
.B --tftp-unique-root.B --tftp-unique-root[=ip|mac]
Add the IP address of the TFTP client as a path component on the endAdd the IP or hardware address of the TFTP client as a path component on the end
of the TFTP-root (in standard dotted-quad format). Only valid if aof the TFTP-root. Only valid if a \fB--tftp-root\fP is set and the directory exists.
tftp-root is set and the directory exists. For instance, if tftp-root is "/tftp" and client Defaults to adding IP address (in standard dotted-quad format).
1.2.3.4 requests file "myfile" then the effective path will beFor instance, if \fB--tftp-root\fP is "/tftp" and client 1.2.3.4 requests file "myfile"
"/tftp/1.2.3.4/myfile" if /tftp/1.2.3.4 exists or /tftp/myfile otherwise.then the effective path will be "/tftp/1.2.3.4/myfile" if /tftp/1.2.3.4 exists or /tftp/myfile otherwise.
 When "=mac" is specified it will append the MAC address instead, using lowercase zero padded digits
 separated by dashes, e.g.: 01-02-03-04-aa-bb
 Note that resolving MAC addresses is only possible if the client is in the local network or obtained
 a DHCP lease from us.
 .TP  .TP
 .B --tftp-secure  .B --tftp-secure
 Enable TFTP secure mode: without this, any file which is readable by  Enable TFTP secure mode: without this, any file which is readable by
 the dnsmasq process under normal unix access-control rules is  the dnsmasq process under normal unix access-control rules is
available via TFTP. When the --tftp-secure flag is given, only filesavailable via TFTP. When the \fB--tftp-secure\fP flag is given, only files
 owned by the user running the dnsmasq process are accessible. If  owned by the user running the dnsmasq process are accessible. If
dnsmasq is being run as root, different rules apply: --tftp-securednsmasq is being run as root, different rules apply: \fB--tftp-secure\fP
 has no effect, but only files which have the world-readable bit set  has no effect, but only files which have the world-readable bit set
 are accessible. It is not recommended to run dnsmasq as root with TFTP  are accessible. It is not recommended to run dnsmasq as root with TFTP
enabled, and certainly not without specifying --tftp-root. Doing soenabled, and certainly not without specifying \fB--tftp-root\fP. Doing so
 can expose any world-readable file on the server to any host on the net.   can expose any world-readable file on the server to any host on the net. 
 .TP  .TP
 .B --tftp-lowercase  .B --tftp-lowercase
Line 1835  specifies a range of ports for use by TFTP transfers.  Line 1991  specifies a range of ports for use by TFTP transfers. 
 useful when TFTP has to traverse a firewall. The start of the range  useful when TFTP has to traverse a firewall. The start of the range
 cannot be lower than 1025 unless dnsmasq is running as root. The number  cannot be lower than 1025 unless dnsmasq is running as root. The number
 of concurrent TFTP connections is limited by the size of the port range.   of concurrent TFTP connections is limited by the size of the port range. 
.TP  .TP
 .B --tftp-single-port
 Run in a mode where the TFTP server uses ONLY the well-known port (69) for its end
 of the TFTP transfer. This allows TFTP to work when there in NAT is the path between client and server. Note that
 this is not strictly compliant with the RFCs specifying the TFTP protocol: use at your own risk.
 .TP
 .B \-C, --conf-file=<file>  .B \-C, --conf-file=<file>
Specify a different configuration file. The conf-file option is also allowed inSpecify a configuration file. The presence of this option stops dnsmasq from reading the default configuration
configuration files, to include multiple configuration files. Afile (normally /etc/dnsmasq.conf). Multiple files may be specified by repeating the option
 either on the command line or in configuration files. A
 filename of "-" causes dnsmasq to read configuration from stdin.  filename of "-" causes dnsmasq to read configuration from stdin.
 .TP  .TP
 .B \-7, --conf-dir=<directory>[,<file-extension>......],  .B \-7, --conf-dir=<directory>[,<file-extension>......],
Line 1850  which have that extension are loaded. So Line 2012  which have that extension are loaded. So
 .B --conf-dir=/path/to/dir,*.conf  .B --conf-dir=/path/to/dir,*.conf
 loads all files with the suffix .conf in /path/to/dir. This flag may be given on the command  loads all files with the suffix .conf in /path/to/dir. This flag may be given on the command
 line or in a configuration file. If giving it on the command line, be sure to  line or in a configuration file. If giving it on the command line, be sure to
escape * characters.escape * characters. Files are loaded in alphabetical order of filename.
 .TP  .TP
 .B --servers-file=<file>  .B --servers-file=<file>
 A special case of   A special case of 
 .B --conf-file  .B --conf-file
which differs in two respects. Firstly, only --server and --rev-server are allowed which differs in two respects. Firstly, only \fB--server\fP and \fB--rev-server\fP are allowed
 in the configuration file included. Secondly, the file is re-read and the configuration  in the configuration file included. Secondly, the file is re-read and the configuration
therein is updated when dnsmasq recieves SIGHUP.therein is updated when dnsmasq receives SIGHUP.
 .SH CONFIG FILE  .SH CONFIG FILE
 At startup, dnsmasq reads  At startup, dnsmasq reads
 .I /etc/dnsmasq.conf,  .I /etc/dnsmasq.conf,
Line 1865  if it exists. (On Line 2027  if it exists. (On
 FreeBSD, the file is   FreeBSD, the file is 
 .I /usr/local/etc/dnsmasq.conf  .I /usr/local/etc/dnsmasq.conf
 ) (but see the   ) (but see the 
.B \-C.B \--conf-file
 and  and
.B \-7.B \--conf-dir
 options.) The format of this  options.) The format of this
 file consists of one option per line, exactly as the long options detailed   file consists of one option per line, exactly as the long options detailed 
 in the OPTIONS section but without the leading "--". Lines starting with # are comments and ignored. For  in the OPTIONS section but without the leading "--". Lines starting with # are comments and ignored. For
Line 1883  clears its cache and then re-loads  Line 2045  clears its cache and then re-loads 
 .I /etc/hosts  .I /etc/hosts
 and   and 
 .I /etc/ethers   .I /etc/ethers 
and any file given by --dhcp-hostsfile, --dhcp-hostsdir, --dhcp-optsfile, and any file given by \fB--dhcp-hostsfile\fP, \fB--dhcp-hostsdir\fP, \fB--dhcp-optsfile\fP,
--dhcp-optsdir, --addn-hosts or --hostsdir.\fB--dhcp-optsdir\fP, \fB--addn-hosts\fP or \fB--hostsdir\fP.
The dhcp lease change script is called for allThe DHCP lease change script is called for all
 existing DHCP leases. If   existing DHCP leases. If 
 .B  .B
 --no-poll  --no-poll
Line 1904  misses and the number of authoritative queries answere Line 2066  misses and the number of authoritative queries answere
 server it gives the number of queries sent, and the number which  server it gives the number of queries sent, and the number which
 resulted in an error. In   resulted in an error. In 
 .B --no-daemon  .B --no-daemon
mode or when full logging is enabled (-q), a complete dump of themode or when full logging is enabled (\fB--log-queries\fP), a complete dump of the
 contents of the cache is made.   contents of the cache is made. 
   
 The cache statistics are also available in the DNS as answers to   The cache statistics are also available in the DNS as answers to 
Line 1937  and Line 2099  and
   
     
 .PP  .PP
Dnsmasq is a DNS query forwarder: it it not capable of recursivelyDnsmasq is a DNS query forwarder: it is not capable of recursively
 answering arbitrary queries starting from the root servers but  answering arbitrary queries starting from the root servers but
 forwards such queries to a fully recursive upstream DNS server which is  forwards such queries to a fully recursive upstream DNS server which is
 typically provided by an ISP. By default, dnsmasq reads  typically provided by an ISP. By default, dnsmasq reads
Line 1985  using  Line 2147  using 
 options or put their addresses real in another file, say  options or put their addresses real in another file, say
 .I /etc/resolv.dnsmasq  .I /etc/resolv.dnsmasq
 and run dnsmasq with the   and run dnsmasq with the 
.B \-r /etc/resolv.dnsmasq.B \--resolv-file /etc/resolv.dnsmasq
 option. This second technique allows for dynamic update of the server  option. This second technique allows for dynamic update of the server
 addresses by PPP or DHCP.  addresses by PPP or DHCP.
 .PP  .PP
Line 2003  the CNAME is shadowed too. Line 2165  the CNAME is shadowed too.
 The tag system works as follows: For each DHCP request, dnsmasq  The tag system works as follows: For each DHCP request, dnsmasq
 collects a set of valid tags from active configuration lines which  collects a set of valid tags from active configuration lines which
 include set:<tag>, including one from the   include set:<tag>, including one from the 
.B dhcp-range.B --dhcp-range
 used to allocate the address, one from any matching   used to allocate the address, one from any matching 
.B dhcp-host.B --dhcp-host
(and "known" if a dhcp-host matches) (and "known" or "known-othernet" if a \fB--dhcp-host\fP matches)
 The tag "bootp" is set for BOOTP requests, and a tag whose name is the   The tag "bootp" is set for BOOTP requests, and a tag whose name is the 
 name of the interface on which the request arrived is also set.  name of the interface on which the request arrived is also set.
   
 Any configuration lines which include one or more tag:<tag> constructs  Any configuration lines which include one or more tag:<tag> constructs
 will only be valid if all that tags are matched in the set derived  will only be valid if all that tags are matched in the set derived
above. Typically this is dhcp-option.above. Typically this is \fB--dhcp-option\fP.
.B dhcp-option .B --dhcp-option
 which has tags will be used in preference  to an untagged   which has tags will be used in preference  to an untagged 
.B dhcp-option,.B --dhcp-option,
 provided that _all_ the tags match somewhere in the  provided that _all_ the tags match somewhere in the
 set collected as described above. The prefix '!' on a tag means 'not'  set collected as described above. The prefix '!' on a tag means 'not'
so --dhcp-option=tag:!purple,3,1.2.3.4 sends the option when theso \fB--dhcp-option=tag:!purple,3,1.2.3.4\fP sends the option when the
 tag purple is not in the set of valid tags. (If using this in a  tag purple is not in the set of valid tags. (If using this in a
 command line rather than a configuration file, be sure to escape !,  command line rather than a configuration file, be sure to escape !,
 which is a shell metacharacter)  which is a shell metacharacter)
   
When selecting dhcp-options, a tag from dhcp-range is second classWhen selecting \fB--dhcp-options\fP, a tag from \fB--dhcp-range\fP is second class
 relative to other tags, to make it easy to override options for  relative to other tags, to make it easy to override options for
 individual hosts, so   individual hosts, so 
.B dhcp-range=set:interface1,.......B --dhcp-range=set:interface1,......
.B dhcp-host=set:myhost,......B --dhcp-host=set:myhost,.....
.B dhcp-option=tag:interface1,option:nis-domain,"domain1".B --dhcp-option=tag:interface1,option:nis-domain,"domain1"
.B dhcp-option=tag:myhost,option:nis-domain,"domain2".B --dhcp-option=tag:myhost,option:nis-domain,"domain2"
 will set the NIS-domain to domain1 for hosts in the range, but  will set the NIS-domain to domain1 for hosts in the range, but
 override that to domain2 for a particular host.  override that to domain2 for a particular host.
   
 .PP  .PP
 Note that for   Note that for 
.B dhcp-range .B --dhcp-range
 both tag:<tag> and set:<tag> are allowed, to both select the range in  both tag:<tag> and set:<tag> are allowed, to both select the range in
use based on (eg) dhcp-host, and to affect the options sent, based onuse based on (eg) \fB--dhcp-host\fP, and to affect the options sent, based on
 the range selected.  the range selected.
   
 This system evolved from an earlier, more limited one and for backward  This system evolved from an earlier, more limited one and for backward
 compatibility "net:" may be used instead of "tag:" and "set:" may be  compatibility "net:" may be used instead of "tag:" and "set:" may be
 omitted. (Except in   omitted. (Except in 
.B dhcp-host,.B --dhcp-host,
 where "net:" may be used instead of "set:".) For the same reason, '#'  where "net:" may be used instead of "set:".) For the same reason, '#'
 may be used instead of '!' to indicate NOT.  may be used instead of '!' to indicate NOT.
 .PP   .PP 
 The DHCP server in dnsmasq will function as a BOOTP server also,  The DHCP server in dnsmasq will function as a BOOTP server also,
 provided that the MAC address and IP address for clients are given,  provided that the MAC address and IP address for clients are given,
 either using   either using 
.B dhcp-host .B --dhcp-host
 configurations or in  configurations or in
 .I /etc/ethers  .I /etc/ethers
 , and a  , and a
.B dhcp-range .B --dhcp-range
 configuration option is present to activate the DHCP server  configuration option is present to activate the DHCP server
on a particular network. (Setting --bootp-dynamic removes the need foron a particular network. (Setting \fB--bootp-dynamic\fP removes the need for
 static address mappings.) The filename  static address mappings.) The filename
 parameter in a BOOTP request is used as a tag,  parameter in a BOOTP request is used as a tag,
 as is the tag "bootp", allowing some control over the options returned to  as is the tag "bootp", allowing some control over the options returned to
 different classes of hosts.  different classes of hosts.
   
 .SH AUTHORITATIVE CONFIGURATION  .SH AUTHORITATIVE CONFIGURATION
 .PP   
 Configuring dnsmasq to act as an authoritative DNS server is  Configuring dnsmasq to act as an authoritative DNS server is
 complicated by the fact that it involves configuration of external DNS  complicated by the fact that it involves configuration of external DNS
 servers to provide delegation. We will walk through three scenarios of  servers to provide delegation. We will walk through three scenarios of
Line 2077  for which dnsmasq is authoritative our.zone.com. Line 2238  for which dnsmasq is authoritative our.zone.com.
 The simplest configuration consists of two lines of dnsmasq configuration; something like  The simplest configuration consists of two lines of dnsmasq configuration; something like
   
 .nf  .nf
.B auth-server=server.example.com,eth0.B --auth-server=server.example.com,eth0
.B auth-zone=our.zone.com,1.2.3.0/24.B --auth-zone=our.zone.com,1.2.3.0/24
 .fi  .fi
   
 and two records in the external DNS  and two records in the external DNS
Line 2101  authoritative zone which dnsmasq is serving, typically Line 2262  authoritative zone which dnsmasq is serving, typically
 we have  we have
   
 .nf  .nf
.B auth-server=our.zone.com,eth0.B --auth-server=our.zone.com,eth0
.B auth-zone=our.zone.com,1.2.3.0/24.B --auth-zone=our.zone.com,1.2.3.0/24
 .fi  .fi
   
 .nf  .nf
Line 2121  entry or  Line 2282  entry or 
 .B --host-record.  .B --host-record.
   
 .nf  .nf
.B auth-server=our.zone.com,eth0.B --auth-server=our.zone.com,eth0
.B host-record=our.zone.com,1.2.3.4.B --host-record=our.zone.com,1.2.3.4
.B auth-zone=our.zone.com,1.2.3.0/24.B --auth-zone=our.zone.com,1.2.3.0/24
 .fi  .fi
   
 If the external address is dynamic, the address  If the external address is dynamic, the address
 associated with our.zone.com must be derived from the address of the  associated with our.zone.com must be derived from the address of the
 relevant interface. This is done using   relevant interface. This is done using 
.B interface-name.B --interface-name
 Something like:  Something like:
   
 .nf  .nf
.B auth-server=our.zone.com,eth0.B --auth-server=our.zone.com,eth0
.B interface-name=our.zone.com,eth0.B --interface-name=our.zone.com,eth0
.B auth-zone=our.zone.com,1.2.3.0/24,eth0.B --auth-zone=our.zone.com,1.2.3.0/24,eth0
 .fi  .fi
   
(The "eth0" argument in auth-zone adds the subnet containing eth0's(The "eth0" argument in \fB--auth-zone\fP adds the subnet containing eth0's
dynamic address to the zone, so that the interface-name returns thedynamic address to the zone, so that the \fB--interface-name\fP returns the
 address in outside queries.)  address in outside queries.)
   
 Our final configuration builds on that above, but also adds a  Our final configuration builds on that above, but also adds a
Line 2150  secondary is beyond the scope of this man-page, but th Line 2311  secondary is beyond the scope of this man-page, but th
 configuration of dnsmasq is simple:  configuration of dnsmasq is simple:
   
 .nf  .nf
.B auth-sec-servers=secondary.myisp.com.B --auth-sec-servers=secondary.myisp.com
 .fi  .fi
   
 and  and
Line 2164  secondary to collect the DNS data. If you wish to rest Line 2325  secondary to collect the DNS data. If you wish to rest
 to particular hosts then  to particular hosts then
   
 .nf  .nf
.B auth-peer=<IP address of secondary>.B --auth-peer=<IP address of secondary>
 .fi  .fi
   
 will do so.  will do so.
   
 Dnsmasq acts as an authoritative server for  in-addr.arpa and  Dnsmasq acts as an authoritative server for  in-addr.arpa and
ip6.arpa domains associated with the subnets given in auth-zoneip6.arpa domains associated with the subnets given in \fB--auth-zone\fP
 declarations, so reverse (address to name) lookups can be simply  declarations, so reverse (address to name) lookups can be simply
 configured with a suitable NS record, for instance in this example,  configured with a suitable NS record, for instance in this example,
 where we allow 1.2.3.0/24 addresses.  where we allow 1.2.3.0/24 addresses.
Line 2187  secondary servers for reverse lookups. Line 2348  secondary servers for reverse lookups.
 When dnsmasq is configured to act as an authoritative server, the  When dnsmasq is configured to act as an authoritative server, the
 following data is used to populate the authoritative zone.  following data is used to populate the authoritative zone.
 .PP  .PP
.B --mx-host, --srv-host, --dns-rr, --txt-record, --naptr-record.B --mx-host, --srv-host, --dns-rr, --txt-record, --naptr-record, --caa-record,
as long as the record names are in the authoritative domain.as long as the record names are in the authoritative domain.
 .PP  .PP
 .B --cname  .B --cname
 as long as the record name is in  the authoritative domain. If the  as long as the record name is in  the authoritative domain. If the
 target of the CNAME is unqualified, then it  is qualified with the  target of the CNAME is unqualified, then it  is qualified with the
authoritative zone name.authoritative zone name. CNAME used in this way (only) may be wildcards, as in
 
 .nf
 .B --cname=*.example.com,default.example.com
 .fi
 
 .PP  .PP
 IPv4 and IPv6 addresses from /etc/hosts (and   IPv4 and IPv6 addresses from /etc/hosts (and 
 .B --addn-hosts  .B --addn-hosts
Line 2206  provided the address falls into one of the subnets spe Line 2372  provided the address falls into one of the subnets spe
 .PP  .PP
 Addresses of DHCP leases, provided the address falls into one of the subnets specified in the  Addresses of DHCP leases, provided the address falls into one of the subnets specified in the
 .B --auth-zone.  .B --auth-zone.
(If contructed DHCP ranges are is use, which depend on the address dynamically (If constructed DHCP ranges are is use, which depend on the address dynamically 
 assigned to an interface, then the form of  assigned to an interface, then the form of
 .B --auth-zone  .B --auth-zone
 which defines subnets by the dynamic address of an interface should  which defines subnets by the dynamic address of an interface should
Line 2228  used, and must match the zone's domain. Line 2394  used, and must match the zone's domain.
   
   
 .SH EXIT CODES  .SH EXIT CODES
 .PP  
 0 - Dnsmasq successfully forked into the background, or terminated  0 - Dnsmasq successfully forked into the background, or terminated
 normally if backgrounding is not enabled.  normally if backgrounding is not enabled.
 .PP  .PP

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>