how to use use local nameservers with public domain?

0

I am testing a dynamic configuration of a nameserver on my local machine. I have a public domain (example.com) that I was trying to point its NS records to my private DNS but my registar does not support local ip addresses for NS records. I'm using the private DNS to map subdomains of example.com to internal ip addresses.

I'm hoping I can use dnsmasq have requests for example.com point at my custom namserver. I"m not sure how to configure it. Accepting other solutions than dnsmasq as well.

example:

I have public domain example.com I have vagrant running bind9 at local ip 192.168.33.10 I want to use the bind9 instance on vagrant as a nameserver form example.com that handles subdomain routing for *.example.com

So on my local machine I want any requests for *.example.com to hit the local bind9 instance and have that handle subdomains to local ip addresses

kevzettler

Posted 2014-02-11T07:05:30.960

Reputation: 137

Can you post up some examples of what you want to do ? – Lawrence – 2014-02-11T07:18:17.833

1

See my answer on StackOverflow (though I expect it to be migrated here soon)

– milli – 2014-02-11T18:23:06.483

@milli that looks like it will help me. One question though. How can I point my local machine to the bind server without touching my LAN router config? This is why I thought dnsmasq could help by just pointing to the bind server. – kevzettler – 2014-02-13T05:43:48.237

Hard-coding it on your local machines, but I'm not a fan of that. Best to fix up the nameservers handed out by DHCP. – milli – 2014-02-13T07:01:40.043

Answers

0

Assuming that your main domain settings are static/IP-based (e.g. the host IP's do not change), why not simply reproduce the external settings on your internal DNS?

Usually there wont be that many. Then just make sure that your internal DNS chains correctly.

Julian Knight

Posted 2014-02-11T07:05:30.960

Reputation: 13 389

This sounds like it would help but I don't know how to do this. Can you give a more detailed example? – kevzettler – 2014-02-11T16:44:26.333

Simply use whatever tools you normally use to set up the local DNS with the same entries as you find on your public facing DNS. Then check that anything else is correctly chained out to the Internet (e.g. you can still ping google.com) – Julian Knight – 2014-02-11T16:53:21.173