LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-15-2008, 08:33 PM   #1
rmarkin
LQ Newbie
 
Registered: Sep 2003
Location: Fernley, NV
Posts: 18

Rep: Reputation: 0
Local name resolution with BIND


Hello,

System:
Ubuntu 7.04
BIND 9.3.4
DHCPD 3.0.4
hostname = nile
local ip = 192.168.1.1


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:


named.conf
Code:
// 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 "127.in-addr.arpa" {
	type master;
	file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
	type master;
	file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
	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";

named.conf.options
Code:
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" { 192.168.1.0/24; };

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

        forwarders {
	 	206.13.31.12;
                68.94.157.1;
	   };

	   

	// # 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:
	// http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0987

	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; 192.168.0.0/24; };

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

named.conf.local
Code:
//
// 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";
	};
homenetwork.hosts
Code:
$ttl 38400
homenetwork.	IN	SOA	nile. (
			1201594146
			10800
			3600
			604800
			38400 )
homenetwork.	IN	NS	nile.
amazon.homenetwork.	IN	A	192.168.1.5
nile.homenetwork.	IN	A	192.168.1.1
basic-server.homenetwork.	IN	A	192.168.1.10

dhcpd.conf
Code:
# DHCP configuration file
ddns-update-style interim;
ignore client-updates;

# Home network
subnet 192.168.1.0 netmask 255.255.255.0 {
	authoritative;
	option routers 192.168.1.1;
	option subnet-mask 255.255.255.0;
	option domain-name-servers 192.168.1.1;
	option ip-forwarding off;
	range dynamic-bootp 192.168.1.50 192.168.1.100;
	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,
Robert
 
Old 02-16-2008, 09:06 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 697

Rep: Reputation: 93
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bind/named local search lost sir-lancealot Linux - Server 1 12-27-2007 03:49 PM
BIND - want to give local IP to internal users quackyo Linux - Networking 5 04-21-2006 06:22 PM
bind & resolve local hosts jingo_man Linux - Networking 7 07-08-2004 03:56 PM
BIND: local TLD work, but not outside TLDs remi Linux - Networking 4 07-06-2004 08:25 AM
bind named and samba to local interfaces kif Linux - Networking 4 02-07-2003 07:34 AM


All times are GMT -5. The time now is 03:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration