Linode Forum Index Linode Forum
Linode Community Forums
 


Using DNS Internally

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
rsosinski



Joined: 14 Jan 2012
Posts: 4

Posted: Sat Jan 14, 2012 8:51 pm    Post subject: Using DNS Internally  

Hello,

I'm interested in having multiple servers for my application, and wanted to know what the best way would be to have them refer to each other internally. For example, an application server in a staging environment (app01.staging) would connect to a database server in staging (db01.staging), instead of using internal ip addresses.

Should I just use the DNS manager, and have the servers point to their full external domain name? Or would that count against bandwidth while also being slower?

Thanks
Back to top  
Vance



Joined: 18 Jan 2009
Posts: 355

Posted: Sun Jan 15, 2012 2:29 pm    Post subject:  

You have probably three options:
1. Put the addresses in the public DNS
2. Run your own nameserver, and serve the private addresses only to your own hosts
3. Put the addresses in the /etc/hosts file of each host

#1 is probably the least work, since you only have to maintain the information in one place. However, some have a philosophical objection to putting private IP addresses in the public DNS. Here is a debate if you're interested. Note that your names would be fully qualified (e.g., db01.staging.example.org instead of db01.staging). Also note that when you change an IP address it will take some time to propagate.

#2 centralizes the list of hosts in one place, and avoids exposing private addresses to the whole Internet. It is probably the most "correct" way, but is IMO too much work unless you're managing many names (dozens), especially if you're not used to running your own nameserver.

#3 is simple, although you need to keep the /etc/hosts file up to date on each host. Though I don't know all the specifics of your situation, this would tend to be my first choice. One advantage is that connections between the hosts can be made without doing a DNS lookup (but only if your nsswitch.conf puts "files" before "dns" for host lookups). When you change the /etc/hosts file on a particular (virtual) machine, it takes effect immediately.
Back to top  
rsosinski



Joined: 14 Jan 2012
Posts: 4

Posted: Mon Jan 16, 2012 9:23 am    Post subject:  

Hey Vance,

Thanks for the reply. I started to use option 1, and put the private IP's into the public DNS system offered by Linode, and I am getting what I need.

Any idea using public DNS would make internal transfer count toward my bandwidth limit?

Thanks!
Back to top  
hybinet



Joined: 02 May 2008
Posts: 1058

Posted: Mon Jan 16, 2012 9:32 am    Post subject:  

rsosinski wrote: Any idea using public DNS would make internal transfer count toward my bandwidth limit?
That would depend on which IP address you put in there. Private IP = no charge.
Back to top  
rsosinski



Joined: 14 Jan 2012
Posts: 4

Posted: Tue Jan 17, 2012 9:58 pm    Post subject:  

hybinet,

Great, that works for me.

I now got everything setup exactly how I want it now. Thanks for all the help everyone.
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1