diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2015-03-19 22:50:22 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2015-03-19 22:50:22 +0000 |
commit | 979fe86bc8693f660eddea232ae39cbbb50b294c (patch) | |
tree | eb07239eb8e64c07067b425edb7a214e9e74bafe | |
parent | ff841ebf5a5d6864ff48571f607c32ce80dbb75a (diff) | |
download | dnsmasq-979fe86bc8693f660eddea232ae39cbbb50b294c.tar.gz |
Make --address=/example.com/ equivalent to --server=/example.com/
-rw-r--r-- | man/dnsmasq.8 | 7 | ||||
-rw-r--r-- | src/network.c | 4 | ||||
-rw-r--r-- | src/option.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 index 2db780d..1f1dd7b 100644 --- a/man/dnsmasq.8 +++ b/man/dnsmasq.8 @@ -460,7 +460,7 @@ but provides some syntactic sugar to make specifying address-to-name queries eas 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. Queries in the domains are never forwarded and always replied to with the specified IP address which may be IPv4 or IPv6. To give @@ -472,7 +472,10 @@ domain specification works in the same was as for --server, with the additional facility that /#/ matches any domain. Thus --address=/#/1.2.3.4 will always return 1.2.3.4 for any query not answered from /etc/hosts or DHCP and not sent to an upstream -nameserver by a more specific --server directive. +nameserver by a more specific --server directive. As for --server, +one or more domains with no address returns a no-such-domain answer, so +--address=/example.com/ is equivalent to --server=/example.com/ and returns +NXDOMAIN for example.com and all its subdomains. .TP .B --ipset=/<domain>/[domain/]<ipset>[,<ipset>] Places the resolved IP addresses of queries for the specified domains diff --git a/src/network.c b/src/network.c index 7045253..992f023 100644 --- a/src/network.c +++ b/src/network.c @@ -1459,7 +1459,7 @@ void check_servers(void) } } - if (!(serv->flags & SERV_NO_REBIND)) + if (!(serv->flags & SERV_NO_REBIND) && !(serv->flags & SERV_LITERAL_ADDRESS)) { if (serv->flags & (SERV_HAS_DOMAIN | SERV_FOR_NODOTS | SERV_USE_RESOLV)) { @@ -1475,7 +1475,7 @@ void check_servers(void) my_syslog(LOG_INFO, _("using local addresses only for %s %s"), s1, s2); else if (serv->flags & SERV_USE_RESOLV) my_syslog(LOG_INFO, _("using standard nameservers for %s %s"), s1, s2); - else if (!(serv->flags & SERV_LITERAL_ADDRESS)) + else my_syslog(LOG_INFO, _("using nameserver %s#%d for %s %s"), daemon->namebuff, port, s1, s2); } #ifdef HAVE_LOOP diff --git a/src/option.c b/src/option.c index eace40b..3009eb5 100644 --- a/src/option.c +++ b/src/option.c @@ -2284,8 +2284,6 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma { if (!(newlist->flags & SERV_NO_REBIND)) newlist->flags |= SERV_NO_ADDR; /* no server */ - if (newlist->flags & SERV_LITERAL_ADDRESS) - ret_err(gen_err); } else if (strcmp(arg, "#") == 0) |