Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an apache with following settings.

192.168.0.105:8080/site1
192.168.0.105:8080/site2
and,
192.168.0.103/blog    

I have 3 other computers in my network. 2 desktops and a laptop.

On every computer, on the browser I want to type some thing like,

example.com/site --> resolve to 192.168.0.105:8080/site1
example.com/site --> resolve to 192.168.0.105:8080/site2

and,

sample.com/blog --> resolve to 192.168.0.103/blog

I want 2 names......example.com and sample.com and I just want it to resolve these addresses for every computer on the network. I dont want it to cache public domain names for local use nor have outside internet access these sites. The above apache is running on a ubuntu 9.04 VM, and I assigned the IPS.

I am following this guide there. http://ubuntuforums.org/showthread.php?t=236093

I am having issues with zone definition and reverse zone definition files. I dont really understand the options. Can some one tell me which options to change to suit my particular case....

// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com.      IN      SOA     ns1.example.com. admin.example.com. (
// Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
 )

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com.      IN      NS              ns1.example.com.
example.com.      IN      MX     10       mta.example.com.

// Replace the IP address with the right IP addresses.
www              IN      A       192.168.0.2
mta              IN      A       192.168.0.3
ns1              IN      A       192.168.0.1

and the reverse zone definition file,

//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my     case, it's 1, as my IP address is 192.168.0.1.
@ IN SOA ns1.example.com. admin.example.com. (
                        20060;
                        28800; 
                        604800;
                        604800;
                        86400 
)

                     IN    NS     ns1.example.com.
1                    IN    PTR    example.com

I am just confused and I'd rather have a clearer understanding of what I am doing than trying a bunch of things. Any help would be great.... Also, please let me know if I am not doing some thing right. Thanks for your time.

share|improve this question
    
+1 for a polite, well-formed and well-illustrated question. –  msanford Dec 17 '10 at 2:07
    
This might be a stupid question, but have you configured your LAN machines to ask for DNS resolution from that bind server you set up? –  msanford Dec 17 '10 at 2:11
1  
If this is only for a few hosts on your local network you might be much better off with something more light-weight like Dnsmasq instead of messing with bind. –  Zoredache Dec 17 '10 at 2:16

1 Answer 1

In your scenario, which sounds like a LAN development case, I would take the easy road and just edit the /etc/hosts file on your three local machines to resolve to your LAN development server, rather than going through the rigmarole of configuring bind on your LAN.

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 

192.168.0.103   sample.com
192.168.0.105   example.com

You'll still get example.com/site1 and /site2 because they're handled by Apache.

The only caveat is that you will have to have the user add the port to the request because you can't specify destination ports in /etc/hosts, or you could use a couple of the simple options available to you through iptables and vhosts.conf.

I'm also assuming this would be an acceptable solution because you said "I just want it to resolve these addresses for [three| computer[s] on the network" and not I want to learn how to configure bind properly.

share|improve this answer

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.