Ubuntu DNS multiple subnets

Posted on 2011-04-22
Last Modified: 2012-05-11
I have configured an Ubuntu server to act as a DNS server.  Everything works fine for the local subnet.  Now I want other subnets to use this server as well for DNS.  To get this to work, do I need to configure additional reverse lookup zones for these  even though I dont need to resolve anything in these zones (just need to resolve public internet) or is there something else I need to do?
Question by:BlakeGriffin
    LVL 31

    Expert Comment

    So you are sure that everything in the local DNS?

    First check it.

    For example if you have

    Issue the following command

    dig @localhost

    Once you are sure that all the domain names resolve correctly to the correct IP address, you have to see if you have domain registration?

    DNS is a network of databases each serving some zones and then when the receive any query that they cannot answer, they forward the request to another server.  So there should be some DNS that forwards request to your DNS that in turn would reply to the queries.


    Author Comment

    Yes I am sure.  I did your dig command and a dig without the @localhost and everything appeared to be find.  In addition, I set another machine on the same subnet as DNS and used the DNS server IP for the DNS setting in the client machine.  Am able to resolve and get to the internet.  When I move to another subnet, resolving doesnt work.  However, I know network connectivity is fine because i can ping and traceroute just fine to the DNS subnet.  Here are the steps I used to config.  Maybe I am missing something.

    sudo vi /etc/bind/named.conf.local

    # This is the zone definition. replace with your domain name

    zone “griffin.local” {
    type master;
    file “/etc/bind/zones/griffin.local.db”;

    # This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0

    zone “” {
    type master;
    file “/etc/bind/zones/”;


    sudo vi /etc/bind/named.conf.options

    forwarders {
    # Replace the address below with the address of your provider’s DNS server;;


    sudo mkdir /etc/bind/zones

    sudo vi /etc/bind/zones/griffin.local.db

    // replace with your domain name. do not forget the . after the domain name!
    // Also, replace ns1 with the name of your DNS server
    griffin.local. IN SOA ns1.griffin.local. admin.griffin.local. (
    // Do not modify the following lines!

    // Replace the following line as necessary:
    // ns1 = DNS Server name
    // mail = mail server name
    // = domain name
    griffin.local. IN NS ns1.griffin.local.

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


    sudo vi /etc/bind/zones/

    //replace with yoour domain name, ns1 with your DNS server name.
    // The number before IN PTR is the machine address of the DNS server. in my case, it’s 1, as my IP address is
    @ IN SOA ns1.griffin.local. admin.griffin.local. (

    IN NS ns1.griffin.local.
    100 IN PTR griffin.local


    Restart Bind server using the following command
    sudo /etc/init.d/bind9 restart

    Testing Your DNS Server

    Modify the file resolv.conf with the following settings

    sudo vi /etc/resolv.conf

    Enter the following details save and exit the file

    // replace with your domain name, and with the address of your new DNS server.

    search griffin.local

    Test your DNS Using the following command

    dig griffin.local
    LVL 31

    Expert Comment

    192.168 ... address is the private address.  Is this the address your host names resolve to?

    What is the live IP public address that your DNS is resolving?

    So you want the addresses to be resolved by any one in the WWW or just from other subnets within your internal network?

    Accepted Solution

    The local network is one private address space that DNS is located on.  Hostnames resolve to this.  The other subnets ( and 192.168.204)  just needs to resove WWW addresses.  I got it to work by adding allow-query { any; }; to the name.conf.options.  Now I just need to figure out how to setup a trusted list.

    Author Comment

    Figured everything out.  Needed to add acl "trusted {  LIST }; to named.conf.local
    LVL 31

    Expert Comment

    Sorry, I thought that you were trying the world to see your DNS.  You were trying to reach external DNS from your network.

    Sorry about that confusion.

    Glad you found it.

    Author Closing Comment

    Found the answer prior to anyone else submitting appropriate answer.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
    There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now