mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Improve --address and --ipset docs, fix --help output
Manual page: clarify that the --address and --ipset options take one or more domains rather than just two. Clarify that --ipset puts addresses in all ipsets, it is not a 1:1 mapping from addresses. Also increase the width for options output in --help, some options were truncated leading to confusing output. Almost all options and descriptions are now within the 120 colums limit.
This commit is contained in:
@@ -480,28 +480,36 @@ but provides some syntactic sugar to make specifying address-to-name queries eas
|
|||||||
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-A\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 the
|
domain specification works in the same was as for \fB--server\fP, with
|
||||||
additional facility that /#/ matches any domain. Thus
|
the 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 upstream
|
query 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.
|
||||||
.TP
|
.TP
|
||||||
.B --ipset=/<domain>/[domain/]<ipset>[,<ipset>]
|
.B --ipset=/<domain>[/<domain>...]/<ipset>[,<ipset>...]
|
||||||
Places the resolved IP addresses of queries for the specified domains
|
Places the resolved IP addresses of queries for one or more domains in
|
||||||
in the specified netfilter ip sets. Domains and subdomains are matched
|
the specified Netfilter IP set. If multiple setnames are given, then the
|
||||||
in the same way as --address. These ip sets must already exist. See
|
addresses 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
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ static struct {
|
|||||||
{ LOPT_DHCP_FQDN, OPT_DHCP_FQDN, NULL, gettext_noop("Use only fully qualified domain names for DHCP clients."), NULL },
|
{ LOPT_DHCP_FQDN, OPT_DHCP_FQDN, NULL, gettext_noop("Use only fully qualified domain names for DHCP clients."), NULL },
|
||||||
{ LOPT_GEN_NAMES, ARG_DUP, "[=tag:<tag>]", gettext_noop("Generate hostnames based on MAC address for nameless clients."), NULL},
|
{ LOPT_GEN_NAMES, ARG_DUP, "[=tag:<tag>]", gettext_noop("Generate hostnames based on MAC address for nameless clients."), NULL},
|
||||||
{ LOPT_PROXY, ARG_DUP, "[=<ipaddr>]...", gettext_noop("Use these DHCP relays as full proxies."), NULL },
|
{ LOPT_PROXY, ARG_DUP, "[=<ipaddr>]...", gettext_noop("Use these DHCP relays as full proxies."), NULL },
|
||||||
{ LOPT_RELAY, ARG_DUP, "<local-addr>,<server>[,<interface>]", gettext_noop("Relay DHCP requests to a remote server"), NULL},
|
{ LOPT_RELAY, ARG_DUP, "<local-addr>,<server>[,<iface>]", gettext_noop("Relay DHCP requests to a remote server"), NULL},
|
||||||
{ LOPT_CNAME, ARG_DUP, "<alias>,<target>[,<ttl>]", gettext_noop("Specify alias name for LOCAL DNS name."), NULL },
|
{ LOPT_CNAME, ARG_DUP, "<alias>,<target>[,<ttl>]", gettext_noop("Specify alias name for LOCAL DNS name."), NULL },
|
||||||
{ LOPT_PXE_PROMT, ARG_DUP, "<prompt>,[<timeout>]", gettext_noop("Prompt to send to PXE clients."), NULL },
|
{ LOPT_PXE_PROMT, ARG_DUP, "<prompt>,[<timeout>]", gettext_noop("Prompt to send to PXE clients."), NULL },
|
||||||
{ LOPT_PXE_SERV, ARG_DUP, "<service>", gettext_noop("Boot service for PXE menu."), NULL },
|
{ LOPT_PXE_SERV, ARG_DUP, "<service>", gettext_noop("Boot service for PXE menu."), NULL },
|
||||||
@@ -475,7 +475,7 @@ static struct {
|
|||||||
{ LOPT_AUTHSOA, ARG_ONE, "<serial>[,...]", gettext_noop("Set authoritive zone information"), NULL },
|
{ LOPT_AUTHSOA, ARG_ONE, "<serial>[,...]", gettext_noop("Set authoritive zone information"), NULL },
|
||||||
{ LOPT_AUTHSFS, ARG_DUP, "<NS>[,<NS>...]", gettext_noop("Secondary authoritative nameservers for forward domains"), NULL },
|
{ LOPT_AUTHSFS, ARG_DUP, "<NS>[,<NS>...]", gettext_noop("Secondary authoritative nameservers for forward domains"), NULL },
|
||||||
{ LOPT_AUTHPEER, ARG_DUP, "<ipaddr>[,<ipaddr>...]", gettext_noop("Peers which are allowed to do zone transfer"), NULL },
|
{ LOPT_AUTHPEER, ARG_DUP, "<ipaddr>[,<ipaddr>...]", gettext_noop("Peers which are allowed to do zone transfer"), NULL },
|
||||||
{ LOPT_IPSET, ARG_DUP, "/<domain>/<ipset>[,<ipset>...]", gettext_noop("Specify ipsets to which matching domains should be added"), NULL },
|
{ LOPT_IPSET, ARG_DUP, "/<domain>[/<domain>...]/<ipset>...", gettext_noop("Specify ipsets to which matching domains should be added"), NULL },
|
||||||
{ LOPT_SYNTH, ARG_DUP, "<domain>,<range>,[<prefix>]", gettext_noop("Specify a domain and address range for synthesised names"), NULL },
|
{ LOPT_SYNTH, ARG_DUP, "<domain>,<range>,[<prefix>]", gettext_noop("Specify a domain and address range for synthesised names"), NULL },
|
||||||
{ LOPT_SEC_VALID, OPT_DNSSEC_VALID, NULL, gettext_noop("Activate DNSSEC validation"), NULL },
|
{ LOPT_SEC_VALID, OPT_DNSSEC_VALID, NULL, gettext_noop("Activate DNSSEC validation"), NULL },
|
||||||
{ LOPT_TRUST_ANCHOR, ARG_DUP, "<domain>,[<class>],...", gettext_noop("Specify trust anchor key digest."), NULL },
|
{ LOPT_TRUST_ANCHOR, ARG_DUP, "<domain>,[<class>],...", gettext_noop("Specify trust anchor key digest."), NULL },
|
||||||
@@ -486,7 +486,7 @@ static struct {
|
|||||||
#ifdef OPTION6_PREFIX_CLASS
|
#ifdef OPTION6_PREFIX_CLASS
|
||||||
{ LOPT_PREF_CLSS, ARG_DUP, "set:tag,<class>", gettext_noop("Specify DHCPv6 prefix class"), NULL },
|
{ LOPT_PREF_CLSS, ARG_DUP, "set:tag,<class>", gettext_noop("Specify DHCPv6 prefix class"), NULL },
|
||||||
#endif
|
#endif
|
||||||
{ LOPT_RA_PARAM, ARG_DUP, "<interface>,[high,|low,]<interval>[,<lifetime>]", gettext_noop("Set priority, resend-interval and router-lifetime"), NULL },
|
{ LOPT_RA_PARAM, ARG_DUP, "<iface>,[<prio>,]<intval>[,<lifetime>]", gettext_noop("Set priority, resend-interval and router-lifetime"), NULL },
|
||||||
{ LOPT_QUIET_DHCP, OPT_QUIET_DHCP, NULL, gettext_noop("Do not log routine DHCP."), NULL },
|
{ LOPT_QUIET_DHCP, OPT_QUIET_DHCP, NULL, gettext_noop("Do not log routine DHCP."), NULL },
|
||||||
{ LOPT_QUIET_DHCP6, OPT_QUIET_DHCP6, NULL, gettext_noop("Do not log routine DHCPv6."), NULL },
|
{ LOPT_QUIET_DHCP6, OPT_QUIET_DHCP6, NULL, gettext_noop("Do not log routine DHCPv6."), NULL },
|
||||||
{ LOPT_QUIET_RA, OPT_QUIET_RA, NULL, gettext_noop("Do not log RA."), NULL },
|
{ LOPT_QUIET_RA, OPT_QUIET_RA, NULL, gettext_noop("Do not log RA."), NULL },
|
||||||
@@ -721,7 +721,7 @@ static void do_usage(void)
|
|||||||
sprintf(buff, " ");
|
sprintf(buff, " ");
|
||||||
|
|
||||||
sprintf(buff+4, "--%s%s%s", opts[j].name, eq, desc);
|
sprintf(buff+4, "--%s%s%s", opts[j].name, eq, desc);
|
||||||
printf("%-40.40s", buff);
|
printf("%-55.55s", buff);
|
||||||
|
|
||||||
if (usage[i].arg)
|
if (usage[i].arg)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user