-   Linux - Software (
-   -   Local name resolution with BIND (

rmarkin 02-15-2008 08:33 PM

Local name resolution with BIND

Ubuntu 7.04
BIND 9.3.4
DHCPD 3.0.4
hostname = nile
local ip =

Machine is functioning as the authoritative dhcp server, name server and gateway for my local network.

DHCP is working fine issuing leases etc.
BIND is working fine as a caching name server.

I would like to have BIND perform local name resolution but am unsure exactly how to implement it.

Config files are below:


// This is the primary configuration file for the BIND DNS server named.
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/etc/bind/db.root";

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";

zone "" {
        type master;
        file "/etc/bind/db.127";

zone "" {
        type master;
        file "/etc/bind/db.0";

zone "" {
        type master;
        file "/etc/bind/db.255";

// zone "com" { type delegation-only; };
// zone "net" { type delegation-only; };

// From the release notes:
//  Because many of our users are uncomfortable receiving undelegated answers
//  from root or top level domains, other than a few for whom that behaviour
//  has been trusted and expected for quite some length of time, we have now
//  introduced the "root-delegations-only" feature which applies delegation-only
//  logic to all top level domains, and to the root domain.  An exception list
//  should be specified, including "MUSEUM" and "DE", and any other top level
//  domains from whom undelegated responses are expected and trusted.
// root-delegation-only exclude { "DE"; "MUSEUM"; };

include "/etc/bind/named.conf.local";


options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you might need to uncomment the query-source
        // directive below.  Previous versions of BIND always asked
        // questions using port 53, but BIND 8.1 and later use an unprivileged
        // port by default.

        // query-source address * port 53;

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders. 
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

acl "ourdomain-subnet" {; };

view "internal" {
        match-clients { "ourdomain-subnet"; };

        forwarders {


        // # auth-nxdomain no;    # conform to RFC1035
        // # listen-on-v6 { any; };

        // By default, name servers should only perform recursive domain
        // lookups for their direct clients.  If recursion is left open
        // to the entire Internet, your name server could be used to
        // perform distributed denial of service attacks against other
        // innocent computers.  For more information on DDoS recursion:

        allow-recursion { "ourdomain-subnet"; };

        // If you have DNS clients on other subnets outside of your
        // server's "localnets", you can explicitly add their networks
        // without opening up your server to the Internet at large:
        // allow-recursion { localnets;; };

        // If your name server is only listening on, consider:
        allow-recursion {; };


// Do any local configuration here

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "homenetwork" {
        type master;
        file "/etc/bind/homenetwork.hosts";


$ttl 38400
homenetwork.        IN        SOA        nile. (
                        38400 )
homenetwork.        IN        NS        nile.
amazon.homenetwork.        IN        A
nile.homenetwork.        IN        A
basic-server.homenetwork.        IN        A


# DHCP configuration file
ddns-update-style interim;
ignore client-updates;

# Home network
subnet netmask {
        option routers;
        option subnet-mask;
        option domain-name-servers;
        option ip-forwarding off;
        range dynamic-bootp;
        default-lease-time 21600;
        max-lease-time 43200;

I would like the client machines on the network to be able to access any of the servers by simply using the hostname instead of the ip. Please let me know if there are any other files that you need to see.

Thank you in advance,

carltm 02-16-2008 09:06 AM

Put lines like this in your named.conf.local file in
the internal view section:

zone "mydomain.tld" {
type master;
file "/etc/bind/db.mydomain.tld";

Next copy /etc/bind/db.local to /etc/bind/db.mydomain.tld
and use this as a template to create your own zone file.

Of course, replace "mydomain.tld" with the domain name
you plan to use.

All times are GMT -5. The time now is 09:13 PM.