LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-28-2011, 12:31 PM   #1
pikeymick
LQ Newbie
 
Registered: Apr 2004
Distribution: Scientific Linux
Posts: 7

Rep: Reputation: 0
Setting up local domains


I'm running Scientific Linux SL release 5.5 (Boron) and I'm trying to setup bind to run local domains for web development testing like mydomain.local.

I'm under the impression that I can do this with caching-nameserver but I'm a noob when it comes to this.

here is my /var/named/chroot/etc/named.caching-nameserver.conf

Code:
#
# Example config created by SilentRage @ www.dollardns.net
#
# Requires:
# http://www.dollardns.net/bind/named.ca
# http://www.dollardns.net/bind/basiczone.com.zone
# http://www.dollardns.net/bind/127.0.0.rev
#
################################################################################
# Server Configuration
#
options {
	# Set the working directory from which all relative paths are based
	# For the win2k default install "C:\WINNT\system32\dns\etc"
	#
	directory "/var/named";

	# RECURSION - Required for caching servers
	# Default: yes
	# Values : yes, no
	#
	# yes: Attempt to resolve requests we are not authoritative for
	# no : Do not resolve requests we are not authoritative for
	#
	recursion yes;

	# ALLOW-RECURSION - Who may use our caching server?
	# Default: any;
	# Values : any, none, (addresslist)
	# 
	# any    : anybody may use the caching server
	# none   : noone may use the caching server
	# address: List of IP addresses that may use the caching server.
	#
	allow-recursion { localhost; localnets; };

	# FORWARD - Recommended for caching servers
	# Default: first
	# Values : first, only
	#
	# first: Query "forwarders" first, then resolve request ourself
	# only : Only query the "forwarders" to resolve requests
	#
	forward first;

	# FORWARDERS - Required if "forward" is used
	# Default: (no forwarding)
	# Values : (addresslist)
	#
	# It is recommended that you use your ISP's caching server addresses
	# Example: forwarders { 127.0.0.1; 127.0.0.2; }
	#
	forwarders {68.87.76.182; 68.87.76.134;};

	# QUERY SOURCE - Useful for caching servers behind a firewall
	# Default: address * port *
	# Values : The IP address and port to use as the source of queries to other servers
	#
	#query-source address * port 53;

	# NOTIFY - Relevant to authoritative servers
	# Default: yes
	# Values : yes, explicit, no
	#
	# yes     : Send DNS NOTIFY messages to slave servers in zone NS records when zone changes
	# explicit: Only send DNS NOTIFY messages to "also-notify" hosts
	# no      : Never automatically send DNS NOTIFY messages
	#
	notify no;
};

################################################################################
# Logging Configuration
#
logging {
    #
    # Define channels for the two log files
    #
    channel query_log {
        severity info;
        print-time yes;
	file "query.log" versions 3 size 100M;
    };
    channel activity_log {
        severity info;
        print-time yes;
        print-category yes;
        print-severity yes;
	file "activity.log" versions 3 size 100M;
    };

    #
    # Send the interesting messages to the appropriate channels
    #
    category queries         { query_log; };

    category default         { activity_log; };
    category xfer-in         { activity_log; };
    category xfer-out        { activity_log; };
    category notify          { activity_log; };
    category security        { activity_log; };

    category update          { activity_log; };
    #category update-security { activity_log; };	# BIND 9.3 only

    #
    # Dump all uninteresting messages
    #
    category network         { null; };
    category lame-servers    { null; };
};

################################################################################
# Zone Configuration
#

#
# Specify the root name servers
#
zone "." IN {
	type hint;
	file "named.ca";
};

#
# Configure ourself as the host for basiczone.com
#
#zone "basiczone.com" IN {
#	type master;
#	file "basiczone.com.zone";
#};

#
# Configure ourself as the host for mydomain.local
#
zone "mydomain.local" IN {
	type master;
	file "mydomain.local.zone";
};

#
# Reverse IP mapping for 127.0.0.x
#
zone "0.0.127.in-addr.arpa" {
	type master;
	file "127.0.0.rev";
};
my mydomain.local.zone file is:

Code:
$TTL 900		; 900 seconds default record (T)ime (T)o (L)ive in cache

@		SOA	ns1 (		; ns1.mydomain.local is the primary server for mydomain.local
			postmaster	; contact email for mydomain.local is postmaster@mydomain.local
			2004041700	; Serial ID in reverse date format
			21600		; Refresh interval for slave servers
			1800		; Retry interval for slave servers
			604800		; Expire limit for cached info on slave servers
			900 )		; Minimum Cache TTL in zone records

@		NS	ns1		; ns1.mydomain.local is a host for mydomain.local
@		NS	ns2		; ns2.mydomain.local is a host for mydomain.local

@		A	127.0.0.4	; mydomain.local's IP address is 127.0.0.4

@		MX	10 mail		; Mail for *@mydomain.local is sent to mail.mydomain.local

ns1		A	127.0.0.1	; ns1.mydomain.local's IP address is 127.0.0.1
ns2		A	127.0.0.2	; ns2.mydomain.local's IP address is 127.0.0.2

mail		A	127.0.0.3	; mail.mydomain.local's IP address is 127.0.0.3

www		A	127.0.0.4	; www.mydomain.local's IP address is 127.0.0.4
I don't even know where to begin for the 127.0.0.rev file, and I'm pretty sure my mydomain.local.zone file is pretty much wrong. All that I can find online are tutorials for DNS on the Internet, I've read through the DNS and Bind O'Reilly book, and I'm now more confused than when I began...

I don't need mail service on this domain, but I'm not sure which part of the records I can just remove without adversely affecting the setup.

named-checkconf named.caching-nameserver.conf Doesn't return any errors.

I could use some help if anyone has the time, thanks.

Last edited by pikeymick; 05-28-2011 at 12:35 PM.
 
Old 05-28-2011, 04:22 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You don't need a caching-only or a forwarding dns. You need an authoritative dns server for the zone mydomain.local.
So you need to remove the following from named.conf (rename named.caching-nameserver.conf to named.conf)
Quote:
forward first;
...
forwarders {68.87.76.182; 68.87.76.134;};
Regarding the zone file, if you want to use only the 127.0.0.0/24 subnet!!!, then you need to edit just the SOA record:
Code:
@ SOA	ns1 root.ns1.mydomain.local. (	; ns1.mydomain.local is the primary server for mydomain.local
			2011052900	; Serial ID in reverse date format
			21600		; Refresh interval for slave servers
			1800		; Retry interval for slave servers
			604800		; Expire limit for cached info on slave servers
			900 )		; Minimum Cache TTL in zone records
If you don't want to receive mail, you can omit the MX record and the line you define the A record of the mail host.

Re. the reverse 0.0.127.in-addr.arpa zone you can use:
Code:
$TTL 86400
@               IN      SOA     ns1.mydomain.local. root.ns1.mydomain.local. (
                                2011052900              ; Serial
                                28800                   ; Refresh
                                7200                    ; Retry
                                604800                  ; Expire
                                86400)                  ; Minimum TTL
                        NS      ns1.mydomain.local.
                        NS      ns2.mydomain.local.

1                       PTR     ns1.mydomain.local.
2                       PTR     ns2.mydomain.local.
3                       PTR     mail.mydomain.local.
4                       PTR     www.mydomain.local.
Regards
 
Old 05-28-2011, 07:48 PM   #3
pikeymick
LQ Newbie
 
Registered: Apr 2004
Distribution: Scientific Linux
Posts: 7

Original Poster
Rep: Reputation: 0
Hey bathory thanks for your help! Those edits got me up and running. nslookup on the linux box gives me:

Code:
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   mydomain.local
Address: 127.0.0.4
In order to get the mydomain.local to resolve on other computers on my local network do I need to change the subnet records of 127.0.0.0 to 192.168.10.0? Or is there some other change I'm missing?
 
Old 05-29-2011, 02:45 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
In order to get the mydomain.local to resolve on other computers on my local network do I need to change the subnet records of 127.0.0.0 to 192.168.10.0? Or is there some other change I'm missing?
If you mean that ns1, ns2, www, mail are different hosts and need to be a accessible from other boxes in your network, then yes. You need to change the 127.0.0.x IPs to 192.168.10.x IPs in the forward zone and of course create a zone file for the 10.168.192.in-addr.arpa reverse zone.
Note that it's not mandatory to have the reverse zone defined for your testing.

Regards
 
  


Reply



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
sendmail smtp local domains issue jer2 Linux - Newbie 1 02-09-2011 11:24 AM
Postfix Error with Virtual domains and local Users shawnbishop Linux - Software 0 09-13-2007 10:43 PM
problem resolving .local domains cricketjeff Linux - Software 5 04-19-2007 06:13 AM
How to spoof multipule domains on local server? Rundi Linux - Networking 1 07-08-2005 05:54 PM
configuring local domains on sarge bro Debian 1 11-28-2003 10:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:12 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration