0

I'm trying to figure out how to build a DNS response that refers the requesting client to try resolve from a different DNS server.

For example,

  1. Client PC makes a request to resolve A record "google.com" from DNS server #1
  2. DNS server #1 reply with a referral to DNS server #2
  3. Client PC makes a request to resolve A record "google.com" from DNS server #2
  4. DNS server #2 reply with a matching A record for "google.com"

enter image description here


How to build a DNS response that refers the client to try resolve from a different DNS server?

Note - I know the best practice is to set the DNS server to recurse the request. However, I purposely want the client to do the hard work.

2
  • The server is not the problem, AFAIK it is standard behavior to send a referral response when a name server does not allow recursion. (You will need to tune the server to only respond with DNS server #1's IP-address as the referral instead of the default hint zone / root servers.) The problem is that clients that expect recursion will only recognize the "no recursion allowed/available" and will see a referral response as an error, rather than follow up on that... – HBruijn Jul 8 '19 at 9:17
  • You seem to model DNS like HTTP with its redirections. It does not work like this. Instead install and manage a recursive nameserver with specific forward and configure your client PC to just use this specific recursive nameserver. If you insist, that specific recursive nameserver can also run on the client PC itself. dnsmasq for example is a simple tool for simple cases like that. Also you are not explaining why you need to do that, and it could help as there are sometimes wrong motivations behind things like that or other way to filter/censor stuff, like bind RPZ feature. – Patrick Mevzek Jul 11 '19 at 5:13
4

Most clients have a stub resolver so I'm not sure they will be capable of handling anything other than a basic "here's the address / not found" response.

The Windows DNS client is a stub resolver, which means that when it needs to resolve a DNS name, it issues a single recursive query to the primary DNS server that is configured on its network interface.

As long as that DNS server responds, no other DNS queries are issued. The DNS server is responsible for handling all additional tasks that are necessary to resolve the DNS query, and the final result is returned to the DNS client.

1
  • Correct. OP wants the client to do the heavy lifting, but simple stub resolvers by definition do not do heavy lifting. – Andrew B Jul 8 '19 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.