Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm a web designer and I often develop new sites for existing businesses. Sometimes I find it useful to point my DNS address (for my personal computer) to the development servers local DNS (instead of Googles 8.8.8.8 or the default isp's address). I like this as it let's me see that the new site's internal links, etc, operate before switching over the authorative DNS from the old site. However outgoing links (Like a Google map) would not route with my local dns. The first thing I thought was, oh I just need to fill out my DNS directory with Google and every other domain I might need to link to, wait... that sounds insane.

I was wondering if anyone could give me insight into a better way or more functional way to get use local DNS addresses when they're available and public supplied DNS address when they are not? Kinda like a DNS to 'roll-over'? Or maybe a completely different approach to development all together.

Thanks in advance for your insight.

All the best!

share|improve this question
1  
I develop both on windows and linux WAMP for windows and apache2 install on linux. I never bothered with any special DNS management between development servers and production servers. I usually only have to upload files, and import a database dump and make minor configuration changes. You could add entries to your hosts file on windows plus use virtual hosts in apache. –  Anagio Feb 25 '12 at 1:49
add comment

4 Answers

I was wondering if anyone could give me insight into a better way or more functional way

Just use DNS-server, which can work in both mode: authoritative for some (local) zones and forwarder to others. Bind, PowerDNS, Posadis...

share|improve this answer
add comment

I add a zone and host entries for each client to the DNS server on my network, but you have to be careful.

If you add a zone of mycustomersdomain.com on your local DNS server, then every computer on your LAN, including your development box will reference that for all host and Mail Exchanger (MX) records. So you have to ensure that you have copied all the A and MX records to your local server before you start adding in your own development hosts (eg dev to get dev.mycustomersdomain.com). If you don't do that you could lose the ability to view your customers existing www site and also be unable to send them mail.

Finding all the A (and other) records from a public server is not possible unless you have 'zone transfer' capability. You may therefore have to ask your customer for this data. In practice, you may only need/want a limited set of records.

If it all goes pear shaped, then you can delete the DNS zone completely but remember that there is a Time To Live (TTL) associated with DNS records so they can hang around for longer than you might like. It's a good idea to set a relatively short TTL for the zone (eg 1 hour) so that you don't get caught out by this.

DNS can be a nightmare, so proceed with caution and be prepared to back pedal if need be.

share|improve this answer
add comment

Generally, when I'm the only person who needs a DNS entry during development, I just add it to my local hosts file.

This file basically allows you to add your own DNS entries local to your machine. On Linux-based systems (and possibly Macs, I'm not sure) the file is located at /etc/hosts, and on Windows it's located at c:\windows\system32\drivers\etc\hosts.

The syntax should be pretty apparent from the examples given, and will only affect your own machine. Any entries in your host file will be referenced first, while the rest of your DNS requests will go to the DNS server you specify in your network settings.

share|improve this answer
add comment

I used to use a local DNS server running on the MAC until I discovered DNSMasq on DD-WRT

I setup a DD-WRT router for my LAN and WIFI and then used the DNSMasq feature of DD-WRT to list all entires that should map to development machines.

Log into your DD-WRT router:

Under Services, Enable DNSMasq

Under "Additional DNSMasq options" list each entry you want to mask:

address=/[url]/[ip]

Examples:

address=/www.dev.mysite.com/192.168.1.10
address=/photos.dev.mysite.com/192.168.1.11
address=/static.dev.mysite.com/192.168.1.12

This is almost like running your own DNS server on the router just for local addresses but without the overhead.

This way I can connect to local development machines via the LAN and all mobile devices via WIFI without much hassle.

Advantages:

  • No DNS server overhead
  • No DNS configuration required just works via DHCP
  • Easily connect mobile devices via WIFI to development machines!
  • Easy to maintain & configure via router interface
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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