I need a little help concerning the configuration of BIND 9 in Ubuntu server 12.04.2. We have a domain company.com with an external registrar. With this, we can manage all DNS settings for the website (www.company.com) which is in a VPS on the Internet.

Now we need to also have the crm application (crm.company.com) accessible from the Internet. However, CRM is on a Linux server in our LAN, different from the one using BIND 9.

How can I configure my BIND to manage the crm.company.com request and forward it to the correct server?

Edit - based on addtional help from mr. douggro

I try to explain better my IT structure concernig mr. douggro suggestion:

PUBLIC REGISTRAR => Manage DNS entry for company.com

INTERMEDIATE SRV => My server with BIND9, IpTbales, eth0 on WAN, eth1 on LAN(

WEB SRV => My server with apache, mysql, php5 eth0 on LAN ( where crm run


There should be nothing you need to do with your BIND configuration. With your DNS being managed through your domain registrar, you should be able to enter a new A Record for crm.company.com that points to the public IP address of your LAN router.
crm.company.com IN A
Apache on your Linux server will need to be configured to handle requests for crm.company.com as a virtual host if the server is not already assigned that hostname.

You will need to configure your LAN router to open and forward necessary ports (like 80 and 8080 for http and https) to the internal LAN IP address of the Linux server.

This works fine if your LAN router is working with a static public IP address. If your router is using a dynamic public IP address, it gets more complicated and you will need to investigate using a dynamic DNS service like dyn.com to manage the DNS for your crm.company.com domain and configure your primary DNS to point to the dynamic DNS service for resolving the subdomain.

Edit - based on addtional info from comments

Since you have an intermediate server acting as a router and running BIND that you want to manage resolving a subdomain, and your primary DNS is being managed through your domain registrar, the resolution to your desired configuration gets a little complicated. Registrars rarely support subdomain DNS services, expecting that either you or your hosting provider handle any subdomain delegation.

The simplest solution I can think of for your desired configuration is to, if possible, run BIND on your VPS and have that become the authoritative host for your domain. You would then need to add an A Record in BIND on the VPS server for your intermediate server after giving it a FQDN and hostname (company.local will not work - it needs to be something like zones.company.com to be resolvable externally.) An additional PTR Record on the VPS for the crm.company.com server should also point to your intermediate server. Then BIND on the intermediate server should be set up with a Master Zone for zones.company.com and add an A Record to it pointing to the LAN IP of the crm server: crm.company.com IN A
You will need to make sure that IPTABLES allows forwarding and pass-through of the ports needed for your CRM system.

  • HI douqqro. Thnak's for replay. It's no so simple. We have a server with BIND9 and IPTABLES and 2 eth (red and green) and a second server on which the CRM is running. So i can not use apache on the first server. The must is that BIND9 can forward the query on the right server – Giacall99 Sep 13 '13 at 15:36
  • @Giacall99 What domain(s) is the BIND server authoritative for? And how does it interface to the WAN - with a public IP address? – douggro Sep 13 '13 at 18:49
  • @douqqro => Thank's for your time. Well, in my BIND i've configured only a master zone company.local. And yes.. we have a public static IP address. – Giacall99 Sep 16 '13 at 8:09
  • So you have an intermediate server not hosting crm running BIND with only a company.local master zone on your LAN linked through a second NIC port to the server running crm, and that intermediate server is also handling your internal LAN IP routing via IPTABLES? – douggro Sep 16 '13 at 14:47
  • @douqqro => Yes. It's correct. In the intermediate server (eth0 wan, eth1 lan) run iptables, BIND9, DHCP local IP BIND9 with a master zone company.local. In other server (eth0 lan) with local IP run a web application for crm. – Giacall99 Sep 17 '13 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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