Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Alternative Domain section to dns page in docs #11458

Merged
merged 11 commits into from
Dec 3, 2021
27 changes: 27 additions & 0 deletions website/content/docs/discovery/dns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,33 @@ pairs according to [RFC1464](https://www.ietf.org/rfc/rfc1464.txt).
Alternatively, the TXT record will only include the node's metadata value when the
node's metadata key starts with `rfc1035-`.

## Alternative Domain

Consul support setting an alternative domain, which is usefull during DNS migrations or if you want to respond to
internal and external queries with different domains.

If you are using [`alt_domain`](/docs/agent/options#alt_domain) parameter, Consul will respond based on the presence of it in your queries.
kbabuadze marked this conversation as resolved.
Show resolved Hide resolved
For exmaple if `test-domain` is configured as an alternative domain the following query:
kbabuadze marked this conversation as resolved.
Show resolved Hide resolved

```shell-session
$ dig @127.0.0.1 -p 8600 consul.service.test-domain SRV
```
will return:
kbabuadze marked this conversation as resolved.
Show resolved Hide resolved

```
;; QUESTION SECTION:
;consul.service.test-domain. IN SRV

;; ANSWER SECTION:
consul.service.test-domain. 0 IN SRV 1 1 8300 machine.node.dc1.test-domain.

;; ADDITIONAL SECTION:
machine.node.dc1.test-domain. 0 IN A 127.0.0.1
machine.node.dc1.test-domain. 0 IN TXT "consul-network-segment="
```

-> **Note:** Response to `<ip>.in-addr.arpa.` will always be returned with your default domain, as there is no way to identify queried domain.
kbabuadze marked this conversation as resolved.
Show resolved Hide resolved

## Service Lookups

A service lookup is used to query for service providers. Service queries support
Expand Down