added Alternative Domain section to dns page in docs

This commit is contained in:
Konstantine 2021-10-30 16:45:58 +03:00
parent 0854e1d684
commit adaaa225e8
1 changed files with 27 additions and 0 deletions

View File

@ -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 response
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.
For exmaple if `test-domain` is configured as an alternative domain the following query:
```shell-session
$ dig @127.0.0.1 -p 8600 consul.service.test-domain SRV
```
will return:
```
;; 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.
## Service Lookups
A service lookup is used to query for service providers. Service queries support