LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2009, 05:23 AM   #1
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Rep: Reputation: 15
Local dns configuration


Hi all i am planning to setup a local dns server in centos 5.3 and further to setup a mail server(for sending mails within intranet).I have termed my local domain as 'centos.local'.After configuration i tried to dig the dns server IP as well as its name.With dns server IP it is working fine but not with dns server name.It gives me error SERVFAIL.Below is my configuration file.Please let me know where i have committed the mistake.Thanks in advance



Code:
#cat /etc/named.caching-nameserver.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 192.168.1.200; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";

// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

allow-query { 192.168.1.200/24; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { 192.168.1.200/24; };
match-destinations { 192.168.1.200/24; };
recursion yes;
include "/etc/named.rfc1912.zones";
};


Code:
#cat /etc/named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};

zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
#Modification started
zone "dns.centos.local" IN {
type master;
file "centos.for";
allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
type master;
file "centos.rev";
allow-update { none; };
};
#Modification ended
zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};

zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};

zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};

Code:
#dig -x 192.168.1.200
; <<>> DiG 9.3.4-P1 <<>> -x 192.168.1.200
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35544
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;200.1.168.192.in-addr.arpa. IN PTR

;; ANSWER SECTION:
200.1.168.192.in-addr.arpa. 86400 IN PTR dns.centos.local.

;; AUTHORITY SECTION:
1.168.192.in-addr.arpa. 86400 IN NS dns.centos.local.

;; Query time: 2 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sat Aug 8 14:39:53 2009
;; MSG SIZE rcvd: 88


Code:
#dig -x dns.centos.local
; <<>> DiG 9.3.4-P1 <<>> -x dns.centos.local
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 52128
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;local.centos.dns.in-addr.arpa. IN PTR

;; Query time: 399 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sat Aug 8 14:40:22 2009
;; MSG SIZE rcvd: 47


#cat /etc/resolv.conf
search centos.local
nameserver 192.168.1.200

Last edited by fizeelinux; 08-08-2009 at 05:33 AM.
 
Old 08-08-2009, 06:59 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
"man dig" tells me that "dig -x" maps adresses to names.
To query for a name use "dig -q dns.centos.local".

Markus
 
Old 08-09-2009, 11:44 PM   #3
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by markush View Post
"man dig" tells me that "dig -x" maps adresses to names.
To query for a name use "dig -q dns.centos.local".

Markus

Thanks but the result is the same as dig -x dns.centos.local with status fail.Is my configuration file correct.Thanks

Last edited by fizeelinux; 08-09-2009 at 11:49 PM.
 
Old 08-10-2009, 12:05 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,641

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
Quote:
#Modification started
zone "dns.centos.local" IN {
type master;
file "centos.for";
allow-update { none; };
};
You said you want to setup the domain centos.local, so you have to change the zone name above. Also post here the zone file centos.for, so we can help you further.

Regards
 
Old 08-10-2009, 11:38 PM   #5
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
You said you want to setup the domain centos.local, so you have to change the zone name above. Also post here the zone file centos.for, so we can help you further.

Regards
Thanks Bathory.I have changed the zone in /etc/named.rfc1912.zones file


zone "centos.local" IN {
type master;
file "centos.for";
allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
type master;
file "centos.rev";
allow-update { none; };
};


And my forward and reverse zone files are as below

Code:
cat /var/named/chroot/var/named/centos.for
$TTL 86400
@ IN SOA dns.centos.local root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS dns.centos.local
dns.centos.local IN A 192.168.1.200
IN AAAA ::1


Code:
cat /var/named/chroot/var/named/centos.rev
$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns.centos.local.
200 IN PTR dns.centos.local.

Please assist me on this.Thanks

Last edited by fizeelinux; 08-10-2009 at 11:40 PM.
 
Old 08-11-2009, 12:02 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,641

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
You miss the dot at the end of the hostnames. Change the zone file to:
Code:
$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
2009081101 ; serial 
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS dns.centos.local.
dns.centos.local. IN A 192.168.1.200
Restart named and see if it works.
 
Old 08-11-2009, 02:10 AM   #7
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
You miss the dot at the end of the hostnames. Change the zone file to:
Code:
$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
2009081101 ; serial 
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS dns.centos.local.
dns.centos.local. IN A 192.168.1.200
Restart named and see if it works.

Thanks for your reply Bathory.

cat /var/named/chroot/var/named/centos.for

$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS dns.centos.local.
dns.centos.local. IN A 192.168.1.200
IN AAAA ::1


I restarted the service but the result status is SERVFAIL.I really dont have any idea on this.Thanks
 
Old 08-11-2009, 02:17 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,641

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
If you don't increase the serial (see the zone file I've posted), named will not be aware of any changes done.
Btw it's better to use the date format for the serial, so you know when you've last change the zone file.
 
Old 08-11-2009, 05:00 AM   #9
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
If you don't increase the serial (see the zone file I've posted), named will not be aware of any changes done.
Btw it's better to use the date format for the serial, so you know when you've last change the zone file.
I have now given the value in the serial field of the 'centos.for' zone file.I am sorry to say that still the same result.

cat /var/named/chroot/var/named/centos.for

$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
2009081601 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS dns.centos.local.
dns.centos.local. IN A 192.168.1.200
 
Old 08-11-2009, 05:33 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,641

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
You must leave at least an empty space before the NS record. It's better use <Tab> for readability:
Code:
$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
2009081602 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

                           IN NS dns.centos.local.
dns.centos.local. IN A 192.168.1.200
Note also that I've increased serial by 1.
 
Old 08-15-2009, 02:32 AM   #11
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
You must leave at least an empty space before the NS record. It's better use <Tab> for readability:
Code:
$TTL 86400
@ IN SOA dns.centos.local. root.dns.centos.local. (
2009081602 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

                           IN NS dns.centos.local.
dns.centos.local. IN A 192.168.1.200
Note also that I've increased serial by 1.

Thanks I followed up the suggestion what you have proposed but problem isnt solved.Any ideas .
 
Old 08-15-2009, 03:45 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,641

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
Could you post the output of "dig dns.centos.local" again?

Since you have enabled logging look at the named.run log file to see if you find anything. You can change the severity to debug from dynamic as you don't have rndc implemented.
You can change the subnet mask from 192.168.1.200/24 to 192.168.1.0/24, so it includes all your subnet and see if it helps.
 
Old 08-18-2009, 09:18 AM   #13
fizeelinux
Member
 
Registered: Nov 2008
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Could you post the output of "dig dns.centos.local" again?

Since you have enabled logging look at the named.run log file to see if you find anything. You can change the severity to debug from dynamic as you don't have rndc implemented.
You can change the subnet mask from 192.168.1.200/24 to 192.168.1.0/24, so it includes all your subnet and see if it helps.

Hi Bathory .I configured local dns in Open SUSE 11.0 .Its working perfectly.Thanks for your help.Cheers.
 
  


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
A DNS learner's question->Is my DNS configuration right? saagar Linux - Newbie 4 01-12-2009 08:44 AM
Local DNS Configuration mboudro Linux - Server 2 11-19-2008 02:37 PM
How to configure DNS for a local LAN (at least I think I want DNS) FlyingPenguin128 Linux - Networking 8 12-11-2005 04:15 PM
DNS configuration: How 2 change from local to remote nameservers Kropotkin Fedora 3 05-31-2005 01:22 PM
dns check outside dns before local reaky Linux - Networking 1 02-22-2004 09:27 AM


All times are GMT -5. The time now is 02:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration