0

I have configured 2 DNS servers, one local and one external (Google DNS). Now I created a webforward from my hosting platform for my domain (e.g. camera.example.com to https://example.com/camera.

On my local DNS server I have a zone for example.com, which redirects me to local servers. However, I can't get camera.example.com to be resolved to https://example.com/camera. When I switch DNS servers around (so local becomes secondary and Google DNS primary), it works fine. But of course I my local DNS records don't work..

Is there a way around this?

1 Answer 1

0

That's the expected result. If both servers are hosting the same domain (example.com), then both of them must be able to answer for all records. The "DNS servers" field allows you to enter multiple servers for redundancy, not for sharding, and the resolver will always take "No such domain" as the final answer.

So set up some procedure to copy local records to Google, and remote records back to your local server.

Or if the number of subdomains in the Google-hosted zone is minimal, remove the Google NS address from the configuration, and instead set up your local server's DNS software to have a bunch of 'forwarder' zones which redirect queries for those subdomains towards Google NS.

// named.conf
zone "camera.example.com" {
    type "forward"; forwarders { <ip>; <ip>; ... };
    //type "static-stub";
}

Actually, delegating these subdomains in the proper way using NS records should work too. I think shouldn't be a problem that you're delegating into a non-root entry (but I can't give guarantees on that).

; local zone
camera.example.com. NS ns-cloud-a1.googledomains.com.
1
  • I'm guessing that's on a linux based device? Our DNS is running on a Windows Server 2008 (for now). So I'd want to add NS records for it to work?
    – CustomX
    Feb 18, 2020 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .