Solved

DNS SETUP UNDER FEDORA CORE 2

Posted on 2004-08-17
3
1,471 Views
Last Modified: 2008-02-01
Hello EE guys

I need some help in my dns setup. The following is the setup of my machine


It has a hostname of linuxbox.
I want to setup a domain as agnelganv.

It has two network card

eth0 172.16.40.4/255.255.0.0
eth1 210.212.161.99/255.255.255.240


I have tried the instructions given at DNS howtos but cannot get dns runnning. I am giving my conf files.

The hosts file is located in \etc and is follows



# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1      localhost.localdomain      localhost
172.16.40.4       linuxbox

The resolv.conf file is located in /etc folder and is follows

nameserver 127.0.0.1


The configuration files for named are stored in /var/named/chroot/etc
and /var/named/chroot/var/named folders respectively. This is with respect to Fedora only. Redhat 9 stores them in /var/named

My named.conf file is as follows


// generated by named-bootconf.pl

options {
      directory "/var/named";
      /*
       * 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 uses an unprivileged
       * port by default.
       */
      // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
      inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
      type hint;
      file "named.ca";
};

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; };
};


zone "agnelganv" {
      type master;
      notify no;
      allow-query { any; };
      file "agnelganv.forward";
            };



zone "40.16.172.in-addr.arpa" {
      type master;
      notify no;
      file "agnelganv.reverse";
      };

include "/etc/rndc.key";


The forward file is named agnelganv.forward and is as follows


;The full zone file

$TTL 3D
@ IN SOA linuxbox.agnelganv. root.agnelganv.(
            200211152
            3600
            3600
            3600
            3600)

NS www ;Inet Address of nameserver

localhost A 127.0.0.1
www A 172.16.40.4


The revers lookup file is named agnelganv.reverse and is as follows


$TTL 3D
@ IN SOA www.linuxbox.agnelganv. root.linuxbox.agnelganv(
            200303301
            8H
            2H
            4W
            1D )

NS www
1 PTR linuxbox.agnelganv


The localhost.zone file is as follows


$ORIGIN localhost.
$TTL 86400
@      IN      SOA      @      root      (
                        48 ; serial
                        10800 ; refresh
                        900 ; retry
                        604800 ; expire
                        86400 ; ttl
                        )


1D            IN      NS      @      
1D            IN      A      127.0.0.1      


The named.local file is as follows

$TTL 86400
@      IN      SOA      localhost.      root.localhost.      (
                        1997022707 ; serial
                        28800 ; refresh
                        14400 ; retry
                        3600000 ; expire
                        86400 ; ttl
                        )



            IN      NS      localhost
1            IN      PTR      localhost

and also the name.ca file is as follows






;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.cache
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    Jan 29, 2004
;       related version of root zone:   2004012900
;
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
;
; formerly C.PSI.NET
;
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; operated by VeriSign, Inc.
;
.                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
;
; operated by RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
;
; operated by ICANN
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; operated by WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File



Now here is my problem.


When i type dig -x 127.0.0.1 i get a reply

When i type dig localhost i get


[root@linuxbox root]# dig localhost
                                                                                                 
; <<>> DiG 9.2.3 <<>> localhost
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 46028
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
                                                                                                 
;; QUESTION SECTION:
;localhost.                     IN      A
                                                                                                 
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Aug 18 05:29:45 2004
;; MSG SIZE  rcvd: 27


and when i type



 dig -x 172.16.40.4
 
; <<>> DiG 9.2.3 <<>> -x 172.16.40.4
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 37911
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;4.40.16.172.in-addr.arpa.      IN      PTR
 
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Aug 18 05:30:17 2004
;; MSG SIZE  rcvd: 42
 

Can you tell me where i missed out. I have also changed the owner and group of the files to named.

Also i get a message in the log when start the dns server


Aug 18 00:02:24 linuxbox named[6669]: starting BIND 9.2.3 -u named -t /var/named/chroot
Aug 18 00:02:24 linuxbox named[6669]: using 1 CPU
Aug 18 00:02:24 linuxbox named[6669]: loading configuration from '/etc/named.conf'
Aug 18 00:02:24 linuxbox named[6669]: listening on IPv4 interface lo, 127.0.0.1#53
Aug 18 00:02:24 linuxbox named[6669]: listening on IPv4 interface eth0, 172.16.40.4#53
Aug 18 00:02:24 linuxbox named[6669]: listening on IPv4 interface eth1, 210.212.161.99#53
Aug 18 00:02:24 linuxbox named[6669]: command channel listening on 127.0.0.1#953
Aug 18 00:02:24 linuxbox named[6669]: dns_master_load: agnelganv.forward:11: unknown RR type 'www'
Aug 18 00:02:24 linuxbox named[6669]: zone agnelganv/IN: loading master file agnelganv.forward: unknown class/type
Aug 18 00:02:24 linuxbox named[6669]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022707
Aug 18 00:02:24 linuxbox named[6669]: dns_master_load: agnelganv.reverse:10: unknown RR type 'www'
Aug 18 00:02:24 linuxbox named[6669]: zone 40.16.172.in-addr.arpa/IN: loading master file agnelganv.reverse: unknown class/type
Aug 18 00:02:24 linuxbox named[6669]: zone localhost/IN: has no NS records
Aug 18 00:02:24 linuxbox named[6669]: running
Aug 18 00:02:24 linuxbox named[6669]: zone 0.0.127.in-addr.arpa/IN: sending notifies (serial 1997022707)
Aug 18 05:32:24 linuxbox named: named startup succeeded



Thanks
Walter


0
Comment
Question by:wfaleiro
  • 2
3 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 11820061
The first problem here is that .agnelganv would be taken as a top-level domain (eg., like .com, .net, etc) and you can't do that. The domain name is going to have to be in one of the recognized top-level domains, say agnelganv.org.

The next problem is that one can't use the short name in a nameserver (NS) declaration. Those fixes suggest that the definition for and contents of the agnelganv.forward zone should look like:

-- in named.conf:
zone "agnelganv.org" {
     type master;
     notify no;
     allow-query { any; };
     file "agnelganv.forward";
};

-- and the zone file:
$TTL 3D
@ IN SOA linuxbox.agnelganv.org. root.agnelganv.org.(
          200211152
          3600
          3600
          3600
          3600)

                  IN NS www.agnelganv.org. ;Inet Address of nameserver

www         IN A 172.16.40.4

Similar changes will be needed in the other zone files.
0
 
LVL 1

Author Comment

by:wfaleiro
ID: 11829208
Hi Jlevie ,
I made the changes and here are the new files

named.conf file



// generated by named-bootconf.pl

options {
      directory "/var/named";
      /*
       * 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 uses an unprivileged
       * port by default.
       */
      // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
      inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
      type hint;
      file "named.ca";
};

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; };
};


zone "agnelganv.org" {
      type master;
      notify no;
      allow-query { any; };
      file "agnelganv.forward";
            };



zone "16.172.in-addr.arpa" {
      type master;
      notify no;
      file "agnelganv.reverse";
      };

include "/etc/rndc.key";



the agnelganv.forward file



;The full zone file

$TTL 3D
@ IN SOA linxubox.agnelganv.org.  root.agnelganv.org.(
            20021152
            3600
            3600
            3600
            3600
            )

 IN NS www.agnelganv.org. ;Inet Address of nameserver

www IN A 172.16.40.4




and the agnelganv.reverse file


$TTL 86400
@ IN SOA linuxbox.agnelganv.org.  root.agnelganv.org. (
            20021152
            3600
            3600
            3600
            3600
             )

 IN  NS www.agnelganv.org.
4.40  IN PTR linuxbox.


But my command dig   localhost
 
; <<>> DiG 9.2.3 <<>> localhost
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1602
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;localhost.                     IN      A
 
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Aug 19 04:43:47 2004
;; MSG SIZE  rcvd: 27
 
[root@linuxbox etc]#



Where as the command

dig linuxbox.agnelganv.org
                                                                                                 
; <<>> DiG 9.2.3 <<>> linuxbox.agnelganv.org
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 44799
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
                                                                                                 
;; QUESTION SECTION:
;linuxbox.agnelganv.org.                IN      A
                                                                                                 
;; AUTHORITY SECTION:
agnelganv.org.          3600    IN      SOA     linxubox.agnelganv.org. root.agnelganv.org. 20021152 3600 3600 3600 3600
                                                                                                 
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Aug 19 04:44:42 2004
;; MSG SIZE  rcvd: 90
                                                                                                 
[root@linuxbox etc]#

Also ping linuxbox.agnelganv.org does not give me any reply. If i type the url linuxbox.agnelganv.org in the browser it does not display the index page of the webserver.

Thanks



0
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 11831876
Those problems result from you not defining linuxbox in the agnelganv.org zone file. From what you say it sounds like the host name of your Linux machine running the DNS is supposed to be linuxbox.agnelganv.org, which would mean that /etc/sysconfig/network should include:

HOSTNAME=linuxbox.agnelganv.org

and that www.agnelganv.org will simply be a web site on this machine. In that case the agnelganv.forward file should look like:

$TTL 86400
@ IN SOA linxubox.agnelganv.org.  root.agnelganv.org.(
          20021152
          3600
          3600
          3600
          3600
          )

 IN NS linuxbox.agnelganv.org. ;Inet Address of nameserver

linuxbox IN A 172.16.40.4
www         IN CNAME linuxbox.agnelganv.org

and the agnelganv.reverse file:

$TTL 86400
@ IN SOA linuxbox.agnelganv.org.  root.agnelganv.org. (
          20021152
          3600
          3600
          3600
          3600
           )

 IN  NS linuxbox.agnelganv.org.
4.40  IN PTR linuxbox.agnelganv.org.

Similar changes will be needed in the loclahost zone files.

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now