version 1.1.1.1, 2013/07/29 19:37:40
|
version 1.1.1.2, 2014/06/15 16:31:38
|
Line 13 Dnsmasq accepts DNS queries and either answers them fr
|
Line 13 Dnsmasq accepts DNS queries and either answers them fr
|
cache or forwards them to a real, recursive, DNS server. It loads the |
cache or forwards them to a real, recursive, DNS server. It loads the |
contents of /etc/hosts so that local hostnames |
contents of /etc/hosts so that local hostnames |
which do not appear in the global DNS can be resolved and also answers |
which do not appear in the global DNS can be resolved and also answers |
DNS queries for DHCP configured hosts. It can also act as the authoritative DNS server for one or more domains, allowing local names to appear in the global DNS. | DNS queries for DHCP configured hosts. It can also act as the |
| authoritative DNS server for one or more domains, allowing local names |
| to appear in the global DNS. It can be configured to do DNSSEC |
| validation. |
.PP |
.PP |
The dnsmasq DHCP server supports static address assignments and multiple |
The dnsmasq DHCP server supports static address assignments and multiple |
networks. It automatically |
networks. It automatically |
Line 199 or
|
Line 202 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 the specified interface. The <domain> is the "glue record". It should resolve in the global DNS to a A and/or AAAA record which points to the address dnsmasq is listening on. | will overide these and provide a different DNS service on the |
| specified interface. The <domain> is the "glue record". It should |
| resolve in the global DNS to a A and/or AAAA record which points to |
| 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 |
| addresses associated with the interface. |
| .TP |
| .B --local-service |
| 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 |
| only has effect is there are no --interface --except-interface, |
| --listen-address or --auth-server options. It is intended to be set as |
| a default on installation, to allow unconfigured installations to be |
| useful but also safe from being used for DNS amplification attacks. |
.TP |
.TP |
.B \-2, --no-dhcp-interface=<interface name> |
.B \-2, --no-dhcp-interface=<interface name> |
Do not provide DHCP or TFTP on the specified interface, but do provide DNS service. |
Do not provide DHCP or TFTP on the specified interface, but do provide DNS service. |
Line 338 by '/', like the --server syntax, eg.
|
Line 354 by '/', like the --server syntax, eg.
|
Don't poll /etc/resolv.conf for changes. |
Don't poll /etc/resolv.conf for changes. |
.TP |
.TP |
.B --clear-on-reload |
.B --clear-on-reload |
Whenever /etc/resolv.conf is re-read, clear the DNS cache. | Whenever /etc/resolv.conf is re-read or the upstream servers are set |
| via DBus, clear the DNS cache. |
This is useful when new nameservers may have different |
This is useful when new nameservers may have different |
data than that held in cache. |
data than that held in cache. |
.TP |
.TP |
Line 406 source address specified but the port may be specified
|
Line 423 source address specified but the port may be specified
|
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>]] |
|
This is functionally the same as |
|
.B --server, |
|
but provides some syntactic sugar to make specifying address-to-name queries easier. For example |
|
.B --rev-server=1.2.3.0/24,192.168.0.1 |
|
is exactly equivalent to |
|
.B --server=/3.2.1.in-addr.arpa/192.168.0.1 |
|
.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 |
Line 496 Return an NAPTR DNS record, as specified in RFC3403.
|
Line 521 Return an NAPTR DNS record, as specified in RFC3403.
|
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 are significant limitations on the target; it must be a |
DNS name which is known to dnsmasq from /etc/hosts (or additional |
DNS name which is known to dnsmasq from /etc/hosts (or additional |
hosts files), from DHCP or from another | hosts files), from DHCP, from --interface-name or from another |
.B --cname. |
.B --cname. |
If the target does not satisfy this |
If the target does not satisfy this |
criteria, the whole cname is ignored. The cname must be unique, but it |
criteria, the whole cname is ignored. The cname must be unique, but it |
Line 508 record (which is always in the C_IN class). The value
|
Line 533 record (which is always in the C_IN class). The value
|
given by the hex data, which may be of the form 01:23:45 or 01 23 45 or |
given by the hex data, which may be of the form 01:23:45 or 01 23 45 or |
012345 or any mixture of these. |
012345 or any mixture of these. |
.TP |
.TP |
.B --interface-name=<name>,<interface> | .B --interface-name=<name>,<interface>[/4|/6] |
Return a DNS record associating the name with the primary address on |
Return a DNS record associating the name with the primary address on |
the given interface. This flag specifies an A 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. If the interface is | not constant, but taken from the given interface. The interface may be |
| followed by "/4" or "/6" to specify that only IPv4 or IPv6 addresses |
| of the interface should be used. If the interface is |
down, not configured or non-existent, an empty record is returned. The |
down, not configured or non-existent, an empty record is returned. The |
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. |
.TP |
.TP |
|
.B --synth-domain=<domain>,<address range>[,<prefix>] |
|
Create artificial A/AAAA and PTR records for an address range. The |
|
records use the address, with periods (or colons for IPv6) replaced |
|
with dashes. |
|
|
|
An example should make this clearer. |
|
.B --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal- |
|
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, |
|
but IPv6 addresses may start with '::' |
|
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. |
|
|
|
The address range can be of the form |
|
<ip address>,<ip address> or <ip address>/<netmask> |
|
.TP |
.B --add-mac |
.B --add-mac |
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 526 server. The MAC address can only be added if the reque
|
Line 569 server. The MAC address can only be added if the reque
|
subnet as the dnsmasq server. Note that the mechanism used to achieve this (an EDNS0 option) |
subnet as the dnsmasq server. Note that the mechanism used to achieve this (an EDNS0 option) |
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. | have security and privacy implications. The warning about caching |
| given for --add-subnet applies to --add-mac too. |
| .TP |
| .B --add-subnet[[=<IPv4 prefix length>],<IPv6 prefix length>] |
| Add the subnet address of the requestor to the DNS queries which are |
| forwarded upstream. The amount of the address forwarded depends on the |
| prefix length parameter: 32 (128 for IPv6) forwards the whole address, |
| zero forwards none of it but still marks the request so that no |
| upstream nameserver will add client address information either. The |
| default is zero for both IPv4 and IPv6. Note that upstream nameservers |
| may be configured to return different results based on this |
| information, but the dnsmasq cache does not take account. If a dnsmasq |
| instance is configured such that different results may be encountered, |
| caching should be disabled. |
.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. |
Line 542 Set the maximum number of concurrent DNS queries. The
|
Line 598 Set the maximum number of concurrent DNS queries. The
|
where this needs to be increased is when using web-server log file |
where this needs to be increased is when using web-server log file |
resolvers, which can generate large numbers of concurrent queries. |
resolvers, which can generate large numbers of concurrent queries. |
.TP |
.TP |
|
.B --dnssec |
|
Validate DNS replies and cache DNSSEC data. When forwarding DNS queries, dnsmasq requests the |
|
DNSSEC records needed to validate the replies. The replies are validated and the result returned as |
|
the Authenticated Data bit in the DNS packet. In addition the DNSSEC records are stored in the cache, making |
|
validation by clients more efficient. Note that validation by clients is the most secure DNSSEC mode, but for |
|
clients unable to do validation, use of the AD bit set by dnsmasq is useful, provided that the network between |
|
the dnsmasq server and the client is trusted. Dnsmasq must be compiled with HAVE_DNSSEC enabled, and DNSSEC |
|
trust anchors provided, see |
|
.B --trust-anchor. |
|
Because the DNSSEC validation process uses the cache, it is not |
|
permitted to reduce the cache size below the default when DNSSEC is |
|
enabled. The nameservers upstream of dnsmasq must be DNSSEC-capable, |
|
ie capable of returning DNSSEC records with data. If they are not, |
|
then dnsmasq will not be able to determine the trusted status of |
|
answers. In the default mode, this menas that all replies will be |
|
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 |
|
.B --trust-anchor=[<class>],<domain>,<key-tag>,<algorithm>,<digest-type>,<digest> |
|
Provide DS records to act a trust anchors for DNSSEC |
|
validation. Typically these will be the DS record(s) for Zone Signing |
|
key(s) of the root zone, |
|
but trust anchors for limited domains are also possible. The current |
|
root-zone trust anchors may be donwloaded from https://data.iana.org/root-anchors/root-anchors.xml |
|
.TP |
|
.B --dnssec-check-unsigned |
|
As a default, dnsmasq does not check that unsigned DNS replies are |
|
legitimate: they are assumed to be valid and passed on (without the |
|
"authentic data" bit set, of course). This does not protect against an |
|
attacker forging unsigned replies for signed DNS zones, but it is |
|
fast. If this flag is set, dnsmasq will check the zones of unsigned |
|
replies, to ensure that unsigned replies are allowed in those |
|
zones. The cost of this is more upstream queries and slower |
|
performance. See also the warning about upstream servers in the |
|
section on |
|
.B --dnssec |
|
.TP |
|
.B --dnssec-no-timecheck |
|
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 |
|
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 is |
|
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 records |
|
which have not been throughly checked. |
|
.TP |
.B --proxy-dnssec |
.B --proxy-dnssec |
A resolver on a client machine can do DNSSEC validation in two ways: it | Copy the DNSSEC Authenticated Data bit from upstream servers to downstream clients and cache it. This is an |
can perform the cryptograhic operations on the reply it receives, or | alternative to having dnsmasq validate DNSSEC, but it depends on the security of the network between |
it can rely on the upstream recursive nameserver to do the validation | dnsmasq and the upstream servers, and the trustworthiness of the upstream servers. |
and set a bit in the reply if it succeeds. Dnsmasq is not a DNSSEC | |
validator, so it cannot perform the validation role of the recursive nameserver, | |
but it can pass through the validation results from its own upstream | |
nameservers. This option enables this behaviour. You should only do | |
this if you trust all the configured upstream nameservers | |
.I and the network between you and them. | |
If you use the first DNSSEC mode, validating resolvers in clients, | |
this option is not required. Dnsmasq always returns all the data | |
needed for a client to do validation itself. | |
.TP |
.TP |
.B --auth-zone=<domain>[,<subnet>[,<subnet>.....]] | .B --dnssec-debug |
| Set debugging mode for the DNSSEC validation, set the Checking Disabled bit on upstream queries, |
| and don't convert replies which do not validate to responses with |
| a return code of SERVFAIL. Note that |
| setting this may affect DNS behaviour in bad ways, it is not an |
| extra-logging flag and should not be set in production. |
| .TP |
| .B --auth-zone=<domain>[,<subnet>[/<prefix length>][,<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, except that 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, or in a subnet corresponding to a contructed DHCP | specified subnets. |
range. The subnet(s) are also used to define in-addr.arpa and | |
ipv6.arpa domains which are served for reverse-DNS queries. For IPv4 | As alternative to directly specifying the subnets, it's possible to |
subnets, the prefix length is limited to the values 8, 16 or 24. | give the name of an interface, in which case the subnets implied by |
| that interface's configured addresses and netmask/prefix-length are |
| used; this is useful when using constructed DHCP ranges as the actual |
| address is dynamic and not known when configuring dnsmasq. The |
| interface addresses may be confined to only IPv6 addresses using |
| <interface>/6 or to only IPv4 using <interface>/4. This is useful when |
| an interface has dynamically determined global IPv6 addresses which should |
| appear in the zone, but RFC1918 IPv4 addresses which should not. |
| Interface-name and address-literal subnet specifications may be used |
| freely in the same --auth-zone declaration. |
| |
| The subnet(s) are also used to define in-addr.arpa and |
| 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. |
| For IPv4 subnets, the prefix length should be have the value 8, 16 or 24 |
| unless you are familiar with RFC 2317 and have arranged the |
| in-addr.arpa delegation accordingly. Note that if no subnets are |
| specified, then no reverse queries are answered. |
.TP |
.TP |
.B --auth-soa=<serial>[,<hostmaster>[,<refresh>[,<retry>[,<expiry>]]]] |
.B --auth-soa=<serial>[,<hostmaster>[,<refresh>[,<retry>[,<expiry>]]]] |
Specify fields in the SOA record associated with authoritative |
Specify fields in the SOA record associated with authoritative |
Line 619 always optional. It is always
|
Line 737 always optional. It is always
|
allowed to have more than one dhcp-range in a single subnet. |
allowed to have more than one dhcp-range 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. If not | 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 |
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 mimimum |
automatically derived from the interface configuration. The mimimum |
size of the prefix length is 64. |
size of the prefix length is 64. |
Line 630 This forms a template which describes how to create ra
|
Line 749 This forms a template which describes how to create ra
|
|
|
.B --dhcp-range=::1,::400,constructor:eth0 |
.B --dhcp-range=::1,::400,constructor:eth0 |
|
|
will look for addresses of the form <network>::1 on eth0 and then create a range from <network>::1 to <network>::400. If the interface is assigned more than one network, then the corresponding ranges will be automatically created, and then deprecated and finally removed again as the address is deprecated and then deleted. The interface name may have a final "*" wildcard. | will look for addresses on |
| eth0 and then create a range from <network>::1 to <network>::400. If |
| the interface is assigned more than one network, then the |
| corresponding ranges will be automatically created, and then |
| deprecated and finally removed again as the address is deprecated and |
| then deleted. The interface name may have a final "*" wildcard. Note |
| that just any address on eth0 will not do: it must not be an |
| autoconfigured or privacy address, or be deprecated. |
|
|
|
If a dhcp-range is only being used for stateless DHCP and/or SLAAC, |
|
then the address can be simply :: |
|
|
|
.B --dhcp-range=::,constructor:eth0 |
|
|
|
|
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 |
Line 650 or from /etc/ethers will be served. A static-only subn
|
Line 782 or from /etc/ethers will be served. A static-only subn
|
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 |
stateless DHCPv6, ie |
stateless DHCPv6, ie |
.B --dhcp=range=::,static | .B --dhcp-range=::,static |
|
|
For IPv4, the <mode> may be |
For IPv4, the <mode> may be |
.B proxy |
.B proxy |
Line 721 the same subnet as some valid dhcp-range. For
|
Line 853 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 dhcp-range declaration. |
|
|
It is allowed to use client identifiers rather than | It is allowed to use client identifiers (called client |
| DUID 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 736 IPv6 addresses may contain only the host-identifier pa
|
Line 869 IPv6 addresses may contain only the host-identifier pa
|
.B --dhcp-host=laptop,[::56] |
.B --dhcp-host=laptop,[::56] |
in which case they act as wildcards in constructed dhcp ranges, with |
in which case they act as wildcards in constructed dhcp ranges, with |
the appropriate network part inserted. |
the appropriate network part inserted. |
Note that in IPv6 DHCP, the hardware address is not normally | Note that in IPv6 DHCP, the hardware address may not be |
available, so a client must be identified by client-id (called client | available, though it normally is for direct-connected clients, or |
DUID in IPv6-land) or hostname. | clients using DHCP relays which support RFC 6939. |
|
|
The special option id:* means "ignore any client-id | and use MAC addresses only." This is useful when a client presents a client-id sometimes |
| For DHCPv4, the special option id:* means "ignore any client-id |
and use MAC addresses only." This is useful when a client presents a client-id sometimes |
and use MAC addresses only." This is useful when a client presents a client-id sometimes |
but not others. |
but not others. |
|
|
Line 763 This is
|
Line 897 This is
|
useful when there is another DHCP server on the network which should |
useful when there is another DHCP server on the network which should |
be used by some machines. |
be used by some machines. |
|
|
The set:<tag> contruct 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 dhcp-host 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 where |
can be set in a dhcp-host directive (but not in other places where |
Line 847 and to set the time-server address to 192.168.0.4, do
|
Line 981 and to set the time-server address to 192.168.0.4, do
|
.B --dhcp-option = 42,192.168.0.4 |
.B --dhcp-option = 42,192.168.0.4 |
or |
or |
.B --dhcp-option = option:ntp-server, 192.168.0.4 |
.B --dhcp-option = option:ntp-server, 192.168.0.4 |
The special address 0.0.0.0 (or [::] for DHCPv6) is taken to mean "the address of the | The special address 0.0.0.0 is taken to mean "the address of the |
machine running dnsmasq". Data types allowed are comma separated | machine running dnsmasq". |
dotted-quad IP addresses, a decimal number, colon-separated hex digits | |
| Data types allowed are comma separated |
| dotted-quad IPv4 addresses, []-wrapped IPv6 addresses, a decimal number, colon-separated hex digits |
and a text string. If the optional tags are given then |
and a text string. If the optional tags are given then |
this option is only sent when all the tags are matched. |
this option is only sent when all the tags are matched. |
|
|
Line 865 keyword, followed by the option number or option name.
|
Line 1001 keyword, followed by the option number or option name.
|
name space is disjoint from the IPv4 option name space. IPv6 addresses |
name space is disjoint from the IPv4 option name space. IPv6 addresses |
in options must be bracketed with square brackets, eg. |
in options must be bracketed with square brackets, eg. |
.B --dhcp-option=option6:ntp-server,[1234::56] |
.B --dhcp-option=option6:ntp-server,[1234::56] |
| For IPv6, [::] means "the global address of |
| the machine running dnsmasq", whilst [fd00::] is replaced with the |
| ULA, if it exists, and [fe80::] with the link-local address. |
|
|
Be careful: no checking is done that the correct type of data for the |
Be careful: no checking is done that the correct type of data for the |
option number is sent, it is quite possible to |
option number is sent, it is quite possible to |
Line 928 DHCP options. This make extra space available in the D
|
Line 1066 DHCP options. This make extra space available in the D
|
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. |
.TP |
.TP |
|
.B --dhcp-relay=<local address>,<server address>[,<interface] |
|
Configure dnsmasq to do DHCP relay. The local address is an address |
|
allocated to an interface on the host running dnsmasq. All 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 |
|
address to multiple remote servers by using multiple dhcp-relay |
|
configs with the same local address and different server |
|
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 |
|
ALL_SERVERS multicast address, ff05::1:3. In this case the interface |
|
must be given, not be wildcard, and is used to direct the multicast to the |
|
correct interface to reach the DHCP server. |
|
|
|
Access control for DHCP clients has the same rules as for the DHCP |
|
server, see --interface, --except-interface, etc. The optional |
|
interface name in the dhcp-relay config has a different function: it |
|
controls on which interface DHCP replies from the server will be |
|
accepted. This is intended for configurations which have three |
|
interfaces: one being relayed from, a second connecting the DHCP |
|
server, and a third untrusted network, typically the wider |
|
internet. It avoids the possibility of spoof replies arriving via this |
|
third interface. |
|
|
|
It is allowed to have dnsmasq act as a DHCP server on one set of |
|
interfaces and relay from a disjoint set of interfaces. Note that |
|
whilst it is quite possible to write configurations which appear to |
|
act as a server and a relay on the same interface, this is not |
|
supported: the relay function will take precedence. |
|
|
|
Both DHCPv4 and DHCPv6 relay is supported. It's not possible to relay |
|
DHCPv4 to a DHCPv6 server or vice-versa. |
|
.TP |
.B \-U, --dhcp-vendorclass=set:<tag>,[enterprise:<IANA-enterprise number>,]<vendor-class> |
.B \-U, --dhcp-vendorclass=set:<tag>,[enterprise:<IANA-enterprise number>,]<vendor-class> |
Map from a vendor-class string to a tag. Most DHCP clients provide a |
Map from a vendor-class string to a tag. Most DHCP clients provide a |
"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 |
Line 956 this to set a different printer server for hosts in th
|
Line 1126 this to set a different printer server for hosts in th
|
"accounts" than for hosts in the class "engineering". |
"accounts" than for hosts in the class "engineering". |
.TP |
.TP |
.B \-4, --dhcp-mac=set:<tag>,<MAC address> |
.B \-4, --dhcp-mac=set:<tag>,<MAC address> |
(IPv4 only) Map from a MAC address to a tag. The MAC address may include | Map from a MAC address to a tag. The MAC address may include |
wildcards. For example |
wildcards. For example |
.B --dhcp-mac=set:3com,01:34:23:*:*:* |
.B --dhcp-mac=set:3com,01:34:23:*:*:* |
will set the tag "3com" for any host whose MAC address matches the pattern. |
will set the tag "3com" for any host whose MAC address matches the pattern. |
Line 978 agent ID and one provided by a relay agent, the tag is
|
Line 1148 agent ID and one provided by a relay agent, the tag is
|
(IPv4 only) A normal DHCP relay agent is only used to forward the initial parts of |
(IPv4 only) A normal DHCP relay agent is only used to forward the initial parts of |
a DHCP interaction to the DHCP server. Once a client is configured, it |
a DHCP interaction to the DHCP server. Once a client is configured, it |
communicates directly with the server. This is undesirable if the |
communicates directly with the server. This is undesirable if the |
relay agent is addding 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 |
Line 995 relays at those addresses are affected.
|
Line 1165 relays at those addresses are affected.
|
Without a value, set the tag if the client sends a DHCP |
Without a value, set the tag if the client sends a DHCP |
option of the given number or name. When a value is given, set the tag only if |
option of the given number or name. When a value is given, set the tag only if |
the option is sent and matches the value. The value may be of the form |
the option is sent and matches the value. The value may be of the form |
"01:ff:*:02" in which case the value must match (apart from widcards) | "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 |
Line 1008 will set the tag "efi-ia32" if the the number 6 appear
|
Line 1178 will set the tag "efi-ia32" if the the number 6 appear
|
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. |
|
|
The special form with vi-encap:<enterpise number> matches against | The special form with vi-encap:<enterprise number> matches against |
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 |
Line 1036 dhcp-host configuration in dnsmasq and the contents of
|
Line 1206 dhcp-host configuration in dnsmasq and the contents of
|
.TP |
.TP |
.B --dhcp-generate-names=tag:<tag>[,tag:<tag>] |
.B --dhcp-generate-names=tag:<tag>[,tag:<tag>] |
(IPv4 only) Generate a name for DHCP clients which do not otherwise have one, |
(IPv4 only) Generate a name for DHCP clients which do not otherwise have one, |
using the MAC address expressed in hex, seperated by dashes. Note that | using the MAC address expressed in hex, separated by dashes. Note that |
if a host provides a name, it will be used by preference to this, |
if a host provides a name, it will be used by preference to this, |
unless |
unless |
.B --dhcp-ignore-names |
.B --dhcp-ignore-names |
Line 1113 timeout has elapsed with no keyboard input, the first
|
Line 1283 timeout has elapsed with no keyboard input, the first
|
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 ommitted 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 |
Line 1172 tried. This flag disables this check. Use with caution
|
Line 1342 tried. This flag disables this check. Use with caution
|
Extra logging for DHCP: log all the options sent to DHCP clients and |
Extra logging for DHCP: log all the options sent to DHCP clients and |
the tags used to determine them. |
the tags used to determine them. |
.TP |
.TP |
|
.B --quiet-dhcp, --quiet-dhcp6, --quiet-ra |
|
Suppress logging of the routine operation of these protocols. Errors and |
|
problems will still be logged. --quiet-dhcp and quiet-dhcp6 are |
|
over-ridden by --log-dhcp. |
|
.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. |
.TP |
.TP |
Line 1262 every call to the script.
|
Line 1437 every call to the script.
|
DNSMASQ_IAID containing the IAID for the lease. If the lease is a |
DNSMASQ_IAID containing the IAID for the lease. If the lease is a |
temporary allocation, this is prefixed to 'T'. |
temporary allocation, this is prefixed to 'T'. |
|
|
|
DNSMASQ_MAC containing the MAC address of the client, if known. |
|
|
|
|
Note that the supplied hostname, vendorclass and userclass data is |
Note that the supplied hostname, vendorclass and userclass data is |
only supplied for |
only supplied for |
"add" actions or "old" actions when a host resumes an existing lease, |
"add" actions or "old" actions when a host resumes an existing lease, |
Line 1412 In the default mode, dnsmasq inserts the unqualified n
|
Line 1587 In the default mode, dnsmasq inserts the unqualified n
|
DHCP clients into the DNS. For this reason, the names must be unique, |
DHCP clients into the DNS. For this reason, the names must be unique, |
even if two clients which have the same name are in different |
even if two clients which have the same name are in different |
domains. If a second DHCP client appears which has the same name as an |
domains. If a second DHCP client appears which has the same name as an |
existing client, the name is transfered to the new client. If | existing client, the name is transferred to the new client. If |
.B --dhcp-fqdn |
.B --dhcp-fqdn |
is set, this behaviour changes: the unqualified name is no longer |
is set, this behaviour changes: the unqualified name is no longer |
put in the DNS, only the qualified name. Two DHCP clients with the |
put in the DNS, only the qualified name. Two DHCP clients with the |
Line 1450 the relevant link-local address of the machine running
|
Line 1625 the relevant link-local address of the machine running
|
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 RDNSS and DNSSL. |
domain-search are used for RDNSS and DNSSL. |
.TP |
.TP |
.B --enable-tftp | .B --ra-param=<interface>,[high|low],[[<ra-interval>],<router lifetime>] |
| Set non-default values for router advertisements sent via an |
| interface. The priority field for the router may be altered from the |
| default of medium with eg |
| .B --ra-param=eth0,high. |
| The interval between router advertisements may be set (in seconds) with |
| .B --ra-param=eth0,60. |
| 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. |
| .B --ra-parm=eth0,0,0 |
| (A value of zero for the interval means the default value.) All three parameters may be set at once. |
| .B --ra-param=low,60,1200 |
| The interface field may include a wildcard. |
| .TP |
| .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). | 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. |
.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 1525 files. If extension(s) are given, any files which end
|
Line 1715 files. If extension(s) are given, any files which end
|
extensions are skipped. Any files whose names end in ~ or start with . or start and end |
extensions are skipped. Any files whose names end in ~ or start with . or start and end |
with # are always skipped. This flag may be given on the command |
with # are always skipped. This flag may be given on the command |
line or in a configuration file. |
line or in a configuration file. |
|
.TP |
|
.B --servers-file=<file> |
|
A special case of |
|
.B --conf-file |
|
which differs in two respects. Firstly, only --server and --rev-server are allowed |
|
in the configuration file included. Secondly, the file is re-read and the configuration |
|
therein is updated when dnsmasq recieves SIGHUP. |
.SH CONFIG FILE |
.SH CONFIG FILE |
At startup, dnsmasq reads |
At startup, dnsmasq reads |
.I /etc/dnsmasq.conf, |
.I /etc/dnsmasq.conf, |
Line 1565 When it receives a SIGUSR1,
|
Line 1762 When it receives a SIGUSR1,
|
writes statistics to the system log. It writes the cache size, |
writes statistics to the system log. It writes the cache size, |
the number of names which have had to removed from the cache before |
the number of names which have had to removed from the cache before |
they expired in order to make room for new names and the total number |
they expired in order to make room for new names and the total number |
of names that have been inserted into the cache. For each upstream | of names that have been inserted into the cache. The number of cache hits and |
| misses and the number of authoritative queries answered are also given. For each upstream |
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 the |
mode or when full logging is enabled (-q), 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 |
| queries of class CHAOS and type TXT in domain bind. The domain names are cachesize.bind, insertions.bind, evictions.bind, |
| misses.bind, hits.bind, auth.bind and servers.bind. An example command to query this, using the |
| .B dig |
| utility would be |
| |
| dig +short chaos txt cachesize.bind |
| |
.PP |
.PP |
When it receives SIGUSR2 and it is logging direct to a file (see |
When it receives SIGUSR2 and it is logging direct to a file (see |
.B --log-facility |
.B --log-facility |
Line 1666 used to allocate the address, one from any matching
|
Line 1873 used to allocate the address, one from any matching
|
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 includes one or more tag:<tag> contructs | 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 dhcp-option. |
.B dhcp-option |
.B dhcp-option |
Line 1674 which has tags will be used in preference to an untag
|
Line 1881 which has tags will be used in preference to an untag
|
.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 the | so --dhcp-option=tag:!purple,3,1.2.3.4 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) |
Line 1791 Something like:
|
Line 1998 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 | .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 |
|
dynamic address to the zone, so that the interface-name returns the |
|
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 |
secondary DNS server. This is another DNS server which learns the DNS data |
secondary DNS server. This is another DNS server which learns the DNS data |
for the zone by doing zones transfer, and acts as a backup should |
for the zone by doing zones transfer, and acts as a backup should |
Line 1822 to particular hosts then
|
Line 2033 to particular hosts then
|
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 |
ipv6.arpa domains associated with the subnets given in auth-zone | ip6.arpa domains associated with the subnets given in auth-zone |
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 1851 IPv4 and IPv6 addresses from /etc/hosts (and
|
Line 2062 IPv4 and IPv6 addresses from /etc/hosts (and
|
.B --addn-hosts |
.B --addn-hosts |
) and |
) and |
.B --host-record |
.B --host-record |
|
and |
|
.B --interface-name |
provided the address falls into one of the subnets specified in the |
provided the address falls into one of the subnets specified in the |
.B --auth-zone. |
.B --auth-zone. |
.PP |
.PP |
Addresses specified by |
|
.B --interface-name. |
|
In this case, the address is not contrained to a subnet from |
|
.B --auth-zone. |
|
|
|
.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. |
|
(If contructed DHCP ranges are is use, which depend on the address dynamically |
|
assigned to an interface, then the form of |
.B --auth-zone |
.B --auth-zone |
OR a constructed DHCP range. In the default mode, where a DHCP lease | which defines subnets by the dynamic address of an interface should |
| be used to ensure this condition is met.) |
| .PP |
| In the default mode, where a DHCP lease |
has an unqualified name, and possibly a qualified name constructed |
has an unqualified name, and possibly a qualified name constructed |
using |
using |
.B --domain |
.B --domain |