-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Tune DNS return code when DC does not exists #8102
Copy link
Copy link
Closed
Labels
theme/dnsUsing Consul as a DNS provider, DNS related issuesUsing Consul as a DNS provider, DNS related issuestype/enhancementProposed improvement or new featureProposed improvement or new feature
Description
Feature Description
For now, DNS returns SERVFAIL if datacenter is not available or if it does not exists. We would like to propose to return NXDOMAIN (RCODE: 3) when datacenter does not exist and keep SERVFAIL if DC exists and cannot be reached.
Use Case(s)
The DNS servers caching queries might use this information to keep track of queries constantly failing and have different behavior for those errors.
Implementation
This information might be already available since we know can find if the DC does exists or not: https://github.com/hashicorp/consul/blob/master/agent/consul/rpc.go#L607 since be50400 has been merged.
So, DNS server would only have to check for:
ErrDCNotAvailableand returnSERVFAIL(current case)ErrNoDCPathreturnNXDOMAIN
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
theme/dnsUsing Consul as a DNS provider, DNS related issuesUsing Consul as a DNS provider, DNS related issuestype/enhancementProposed improvement or new featureProposed improvement or new feature