Mobile app version of vmapp.org
Login or Join
Courtney195

: Using local DNS and public DNS during site development 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

@Courtney195

Posted in: #Dns

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!

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

4 Comments

Sorted by latest first Latest Oldest Best

 

@Fox8124981

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

10% popularity Vote Up Vote Down


 

@Angie530

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:windowssystem32driversetchosts.

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.

10% popularity Vote Up Vote Down


 

@Fox8124981

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.

10% popularity Vote Up Vote Down


 

@Berryessa370

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...

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme