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 // // 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 ;; 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 ;; 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 |
"man dig" tells me that "dig -x" maps adresses to names.
To query for a name use "dig -q dns.centos.local". Markus |
Quote:
Thanks but the result is the same as dig -x dns.centos.local with status fail.Is my configuration file correct.Thanks |
Quote:
Regards |
Quote:
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 @ 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 @ 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 |
You miss the dot at the end of the hostnames. Change the zone file to:
Code:
$TTL 86400 |
Quote:
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 |
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. |
Quote:
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 |
You must leave at least an empty space before the NS record. It's better use <Tab> for readability:
Code:
$TTL 86400 |
Quote:
Thanks I followed up the suggestion what you have proposed but problem isnt solved.Any ideas . |
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. |
Quote:
Hi Bathory .I configured local dns in Open SUSE 11.0 .Its working perfectly.Thanks for your help.Cheers. |
All times are GMT -5. The time now is 03:07 AM. |