Need a good & working DSN files for RHE AS

Can someone give me a good & working example(s) a DNS setup on RHE AS.   Too many examples out there have generic terminologies like "nethost.dummy" (example).  I need something that works (you can edit your names and IPs if you want).   Or if you have a complete HOW-TO file, that's would also be good.  I need step-by-step instructions what files to modify, why, how, etc . to have a working DNS setup.  
LVL 1
ROCK1972Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ravenplCommented:
I'm not sure if I understand what You mean, since there is working configuration shipped with bind.
It has two domains (localhost & 127.in-addr.arpa).
But anyway, there's another example:

options {
        directory "/var/named";
        allow-transfer { 192.168.0/24; 10.10.10/24; };
        listen-on-v6 { none; };
        listen-on { 127.0.0.1; 192.168.0.18; };
        // if you have problems and are behind a firewall:
        //query-source address * port 53;
        pid-file "/var/run/named/named.pid";
};

ravenplCommented:
// a caching only nameserver config
zone "." IN {
        type hint;
        file "named.ca";
};

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

zone "working.com" IN {
        type master;
        file "master/working.com";
};
zone "slave.com" IN {
        type slave;
        file "slave/slave.com";
        masters { 10.10.10.1; };
};

And zone files follows
/var/named/named.local

$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.

1       IN      PTR     localhost.

/var/named/master/working.com
$TTL    1D
@       IN      SOA     dns.working.com. dns.working.com.  (
                                      2004110306; Serial
                                      6H        ; Refresh
                                      2H        ; Retry
                                      1W        ; Expire
                                      1D )      ; Minimum

        IN      NS      dns.working.com.
        IN      NS      ns2.working.com.
        IN      MX      0       mail.working.com.

        IN      A       192.168.0.20

dns     IN      A       192.168.0.20
ns2    IN      A       192.168.0.18
ftp     IN      A       192.168.0.20
mail    IN      A       192.168.0.20
www     IN      A       192.168.0.20

there is no /var/named/slave/slave.com file created by me, named creates it automatically.

And, maybe You should tell us what You want to do, then we could help You more acurately.
ROCK1972Author Commented:
Hi ravenpl.

This is with reference to : http://www.experts-exchange.com/Networking/Linux_Networking/Q_21473890.html

I have been asking Redimido some more questions, but he didn't answer back (I guess he was either fed up or got his points and his job was done *laugh*).  
But he gave me some good pointers, and I managed to get my DNS service working, partially.  

Take a look.  

Jul  5 15:34:38 ns1 named[11033]: starting BIND 9.2.2 -u named
Jul  5 15:34:38 ns1 named[11033]: using 1 CPU
Jul  5 15:34:38 ns1 named[11033]: loading configuration from '/etc/named.conf'
Jul  5 15:34:38 ns1 named[11033]: no IPv6 interfaces found
Jul  5 15:34:38 ns1 named[11033]: listening on IPv4 interface lo, 127.0.0.1#53
Jul  5 15:34:38 ns1 named[11033]: listening on IPv4 interface eth0, 172.30.2.85#53
Jul  5 15:34:38 ns1 named[11033]: command channel listening on 127.0.0.1#953
Jul  5 15:34:38 ns1 named[11033]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Jul  5 15:34:38 ns1 named[11033]: zone wsn50.com/IN: loaded serial 1997022700
Jul  5 15:34:38 ns1 named[11033]: zone 2.30.172.in-addr-arpa/IN: loaded serial 1997022700
Jul  5 15:34:38 ns1 named[11033]: zone localhost/IN: loaded serial 42
Jul  5 15:34:38 ns1 named[11033]: running

No errors! ;)  

It looks like DNS is starting well, and is working, because if I stop the service I get this :

[root@test /root]# ping ns1
ping: unknown host ns1

If I start it, I get this :

[root@test /root]# ping ns1
PING ns1.wsn50.com (172.30.2.85) from 172.30.2.71 : 56(84) bytes of data.
 
--- ns1.wsn50.com ping statistics ---
8 packets transmitted, 1 packets received, 87% packet loss
round-trip min/avg/max/mdev = 0.139/0.139/0.139/0.000 ms
[root@lmclx108212 /root]#

Which is better, but its not pinging  Any idea why and how to troubleshoot this?  


Here are my files :

:::::: /etc/resolv.conf ::::::
; generated by /sbin/dhclient-script
search wsn50.com
nameserver 127.0.0.1
nameserver 172.30.2.85

:::::: /etc/named.conf ::::::

// 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 "wsn50.com" IN {
        type master;
        file "wsn50.com.zone";
};
 
zone "2.30.172.in-addr-arpa" {
        type master;
        file "172.30.2";
};
 
zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};
 
include "/etc/rndc.key";

:::::: /var/named ::::::

# more 172.30.2
; Reverse mapping of domain names 2.30.172.in-addr-arpa
$TTL    86400
@       IN      SOA     ns1.wsn50.com. hostmaster.ns1.wsn50.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      ns1.wsn50.com.
 
85              PTR             ns1.wsn50.com.
85              PTR             mail.wsn50.com.
71              PTR             test.wsn50.com.

[root@ns1 named]# more wsn50.com.zone
$TTL    86400
$ORIGIN wsn50.com.
@       IN      SOA    ns1.wsn50.com. hostmaster.wsn50.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
 
                IN      NS              ns1.wsn50.com.
                IN      MX      10      mail.wsn50.com.
                IN      A               172.30.2.85
 
ns1             IN      A               172.30.2.85
mail            IN      A               172.30.2.85
test             IN      A               172.30.2.71

[root@ns1 named]# more named.local
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.
 
1       IN      PTR     localhost.
[root@ns1 named]# more localhost.zone
$TTL    86400
$ORIGIN localhost.
@                       1D IN SOA       @ root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
 
                        1D IN NS        @
                        1D IN A         127.0.0.1
[root@ns1 named]#

OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

ravenplCommented:
> 8 packets transmitted, 1 packets received, 87% packet loss
Well, that's not DNS problem. You DNS look fine, and as You told works fine.
Since 1 pacet got it way back, i assume this is not a firewall problem also.
This might be a link problem (a router or bridge between those two machines)?
could You try:
traceroute ns1
ROCK1972Author Commented:
When I ping the address directly, it responds no problem.  

[root@test /root]# traceroute ns1
traceroute to ns1.wsn50.com (172.30.2.85), 30 hops max, 38 byte packets
 1  172.30.2.85 (172.30.2.85)  0.181 ms  0.208 ms  0.187 ms
[root@test /root]# ping ns1
PING ns1.wsn50.com (172.30.2.85) from 172.30.2.71 : 56(84) bytes of data.
                                                                                                                                                       
--- ns1.wsn50.com ping statistics ---
33 packets transmitted, 1 packets received, 96% packet loss
round-trip min/avg/max/mdev = 0.130/0.130/0.130/0.000 ms
[root@test /root]# ping 172.30.2.85
PING 172.30.2.85 (172.30.2.85) from 172.30.2.71 : 56(84) bytes of data.
64 bytes from 172.30.2.85: icmp_seq=0 ttl=64 time=129 usec
64 bytes from 172.30.2.85: icmp_seq=1 ttl=64 time=130 usec
64 bytes from 172.30.2.85: icmp_seq=2 ttl=64 time=144 usec
                                                                                                                                                       
--- 172.30.2.85 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/mdev = 0.129/0.134/0.144/0.011 ms

So there's really no problem where IP address are concerned, its more on the DNS side, and its always the same scenario.  1 packet received, the rest are lost.  Any idea.  No firewall running on any of these machines.
ROCK1972Author Commented:
I did some more stats :

--- ns1.wsn50.com ping statistics ---
68364 packets transmitted, 1519 packets received, 97% packet loss
round-trip min/avg/max/mdev = 0.120/0.135/0.163/0.017 ms

So some packets are going through... any suggestions how I can troubleshoot this?   If you dont know, its OK, Ill give you the points for you help regardless.  Thanks.  
ravenplCommented:
No, it's not gonna end like this.
A bunch of hints

first try: 'ping -n ns1' - does it helps?
then
> zone "2.30.172.in-addr-arpa" {
>        type master;
>        file "172.30.2";
>};
change it to
zone "2.30.172.in-addr.arpa" {
that's the real name of domain anyway.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ROCK1972Author Commented:
'ping -s ns1' works.  And your change fixed my problem.  

Thank you so much for your help!  

ravenplCommented:
No prob.
But still I didn't meet the problem, that invalid rev-dns makes ping not to work.
It's strange anyway...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.