From 832eb77103754ba930012e5225e19870815e473d Mon Sep 17 00:00:00 2001 From: fusiondog Date: Thu, 9 Jun 2016 14:29:54 -0700 Subject: [PATCH] Adding more detail about best use case. --- .../source/docs/guides/forwarding.html.markdown | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/website/source/docs/guides/forwarding.html.markdown b/website/source/docs/guides/forwarding.html.markdown index dc4444b18..32b29a979 100644 --- a/website/source/docs/guides/forwarding.html.markdown +++ b/website/source/docs/guides/forwarding.html.markdown @@ -11,12 +11,13 @@ description: |- By default, DNS is served from port 53. On most operating systems, this requires elevated privileges. Instead of running Consul with an administrative or root account, it is possible to instead forward appropriate queries to Consul, -running on an unprivileged port, from another DNS server. +running on an unprivileged port, from another DNS server or port redirect. In this guide, we will demonstrate forwarding from [BIND](https://www.isc.org/downloads/bind/) as well as [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) and [iptables](http://www.netfilter.org/). -For the sake of simplicity, BIND and Consul are running on the same machine in this example, -but this is only required for iptables. +For the sake of simplicity, BIND and Consul are running on the same machine in this example. For iptables the +rules must be set on the same host as the Consul instance and relay hosts should not be on the same host or +the redirects will intercept the traffic. It is worth mentioning that, by default, Consul does not resolve DNS records outside the `.consul.` zone unless the @@ -131,7 +132,12 @@ for additional details): On Linux systems that support it, incoming requests and requests to localhost can use `iptables` to forward ports on the same machine without a secondary service. Since Consul, by default, only resolves the `.consul` TDL, it is especially important to use the `recursors` option if you wish the -`iptables` setup to resolve for other domains. +`iptables` setup to resolve for other domains. The recursors should not include the localhost as the +redirects would just intercept the requests. The iptables method is suited for situations where an +external DNS service is already running in your infrastructure is used as the recursor or if you want +to use an existing DNS server as your query endpoint and forward requests for the consul domain to the +consul server. In both of those cases you may want to query the consul server but not need the overhead +of a separate service on the consul host. ``` [root@localhost ~]# iptables -t nat -A PREROUTING -p udp -m udp --dport 53 -j REDIRECT --to-ports 8600