?
Solved

Configure DNS Server on RHEL 4.0

Posted on 2005-03-15
18
Medium Priority
?
4,483 Views
Last Modified: 2008-01-09
Dear Experts,

I would be very much appreciated if someone could help me with a project I am planning to do. I want to manage my own DNS server rather then my ISP. Currently I am running Redhat Linux Enterprise Server 4.0 and I am hosting hosting ( Mail- Sendmail ) and (Web- Apache ) server for a comapny where I am working.  

Is it possible if I manage my own DNS record?  How would I start this project?

I had some experiences setting up Local DNS record on Redhat 8.0 before but there are some changes within RHEL 4.0 which leaded me to the confusion. I have read through the "named.conf" file but there are some (IPV6) record embed in there and I have not idea how to utilize IPV6...

I would like to thank you in advance for helping...
0
Comment
Question by:linxcelent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 9
18 Comments
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13545851
You can ignore the ipv6 records simply add a zone declaration to you named.conf

One thing to note is that for correct DNS you should have a minimum of one slave server and that should be located on a physically seperate netblock.

zone "domain.co.uk" in {
        type master;
        file "domain.zone";
        allow-query {any;};
        notify yes;
};

Then create domain.zone file

$TTL 86400      ; 1 day
domain.co.uk.    IN      SOA     server.domain.co.uk. support.domain.co.uk. (
                        2004091201
                        21600
                        1800
                        5D
                        3600 )

nameserver           IN NS   alpha

server                    IN A    ipaddress
0
 

Author Comment

by:linxcelent
ID: 13546172
Thank you for a quick respond.

Let's see if I understand your command above correctely:  I have to have two physical server to run DNS server? or there is another way to setup DNS server utilizing one physical server.
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13546266
You can run DNS from one server it is not recommended though.
0
A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

 

Author Comment

by:linxcelent
ID: 13546522
I don't have two physical server running right now.  I would like run DNS on one server just for now.  If this work out OK for me then I will try to get another server to run secondary DNS.  How would I configure DNS on one server?  Could you please give me some detail example?

Thank you
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13546584
I have already given you pretty much the edits you have to make I would need to have the actual details of your server.

You will also need to have your isp / provider change the glue on at the top level domain to point dns querys at your server.
0
 

Author Comment

by:linxcelent
ID: 13546837
I guest I couldn't get away from bothering my ISP huh? :(
------------------------>>> Detail <<<------------------------------------
My server's netbios name is: mhost
My domain is: testdomain.com
My IP address: 64.248.xx.xxx

CNAMES:

mail    IN    CNAME    mhost.testdomain.com.
smtp   IN    CNAME    mhost.testdomain.com.
www   IN    CNAME    mhost.testdomain.com.
ftp      IN    CNAME    mhost.testdomain.com.
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13553456
Certainly not unfortaunatly

Fire up your favorite text editor edit named.conf add the following zone definition

zone "mhost.testdomain.com" in {
        type master;
        file "testdomain.com.zone";
        allow-query {any;};
        notify yes;
};

Then create testdomain.com.zone file

$TTL 86400      ; 1 day
testdomain.com.    IN      SOA     testdomain.com. support.testdomain. (
                        2005031601
                        21600
                        1800
                        5D
                        3600 )

nameserver           IN NS   mhost

mhost                    IN A    64.248.xx.xxx

mail    IN    CNAME    mhost.testdomain.com.
smtp   IN    CNAME    mhost.testdomain.com.
www   IN    CNAME    mhost.testdomain.com.
ftp      IN    CNAME    mhost.testdomain.com.

Then restart bind check the error logs for messages grep named /var/log/messages

REMEMBER DNS is cached all over the interent it can take upto 3 full days for new settings to propogate!

0
 

Author Comment

by:linxcelent
ID: 13555087
Thank you for all your help, I would love to try the method above but my ISP is already hosted two domain names for me already.  

I wonder if I may ask you to help me setting up DNS for local mail only? Here is my named.conf file that I tried to setup for local DNS:

/etc/named.conf

//
// named.conf for Red Hat caching-nameserver
//

options {
      directory "/var/named";
      dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
      /*
       * 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;
      listen-on { 127.0.0.1; 192.168.1.10; };
      forward only;
      forwarders { 64.248.xx.xxx; };
      allow-transfer { 192.168.1/24; };
      allow-query { 127.0.0.1; 192.168.1/24; };
};

//
// a caching only nameserver config
//
controls {
      inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

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

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

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

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

include "/etc/rndc.key";
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13555513
Did you create the zone file /etc/named/testdomain.com.zone ? You need to add an MX (mailexchanger) record so

$TTL 86400      ; 1 day
testdomain.com.    IN      SOA     testdomain.com. support.testdomain. (
                        2005031602
                        21600
                        1800
                        5D
                        3600 )

testdomain.com      IN NS   mhost
testdomain.com      IN MX mhost

mhost                    IN A    64.248.xx.xxx

mail    IN    CNAME    mhost.testdomain.com.
smtp   IN    CNAME    mhost.testdomain.com.
www   IN    CNAME    mhost.testdomain.com.
ftp      IN    CNAME    mhost.testdomain.com.

This will only work for computers on yournetwork which use mhost for their dns
0
 

Author Comment

by:linxcelent
ID: 13556315
Yes, I created two zone files in /var/namd: testdomain.com.zone and testdomain.com.rev You said it should be in the /etc/named? There is no such directory in the /etc/named subfolder.
Here is my zone file look like:

# /var/named/testdomain.con.zone
$TTL 86400
@      IN SOA      mhost.testdomain.com. postmaster.testdomain.com. (
            2005031501      ; Serial
            10800            ; Refresh
            3600            ; Retry
            604800            ; Expire
            86400 )            ; Minimum
      IN NS      mhost.testdomain.com.
      IN MX      10 mhost.testdomain.com.
mhost      IN A      192.168.1.10
www      IN CNAME      mhost.testdomain.com.
mail      IN CNAME      mhost.testdomain.com.
smtp      IN CNAME      mhost.testdomain.com.

# /var/named/testdomain.com.rev
$TTL 86400
@      IN SOA      mhost.testdomain.com. postmaster.testdomain.com. (
            2005031501      ; Serial
            10800            ; Refresh
            3600            ; Retry
            604800            ; Expire
            86400 )            ; Minimum
      IN NS      mhost.testdomain.com.
1      IN PTR      mhost.testdomain.com.

After I created those two zone files I restarted "service named restart". The service replied with an OK which mean my dns is up and running.  But when I query the my Local domain name utilizing "dig www.testdomain.com", I got error reply like this:

; <<>> DiG 9.2.4 <<>> www.testdomain.com
;; global options: printcmd
;; connection time out; no servers could be reached

Please notice: This is for local dns only, only within the company use not out side world.


0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13563125
Sorry I meant /var/named/
0
 

Author Comment

by:linxcelent
ID: 13566597
After I created those two zone files I restarted "service named restart". The service replied with an OK which mean my dns is up and running.  But when I query the my Local domain name utilizing "dig www.testdomain.com", I got error reply like this:

; <<>> DiG 9.2.4 <<>> www.testdomain.com
;; global options: printcmd
;; connection time out; no servers could be reached

Please notice: This is for local dns only, only within the company use not out side world.
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13570602
Can you check the message log for errors

grep named /var/log/messages (or /var/log/syslog cant remember which log red hats uses)
0
 

Author Comment

by:linxcelent
ID: 13574467
It's under  /var/log/messages
Here is the detail:

Mar 18 08:41:21 mhost named[4121]: starting BIND 9.2.4 -u named -t /var/named/chroot
Mar 18 08:41:21 mhost named[4121]: using 1 CPU
Mar 18 08:41:21 mhost named: named startup succeeded
Mar 18 08:41:21 mhost named[4121]: loading configuration from '/etc/named.conf'
Mar 18 08:41:21 mhost named[4121]: listening on IPv4 interface lo, 127.0.0.1#53
Mar 18 08:41:21 mhost named[4121]: listening on IPv4 interface eth0, 192.168.1.1#53
Mar 18 08:41:21 mhost named[4121]: command channel listening on 127.0.0.1#953
Mar 18 08:41:21 mhost named[4121]: zone 0.in-addr.arpa/IN: loaded serial 42
Mar 18 08:41:21 mhost named[4121]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Mar 18 08:41:21 mhost named[4121]: zone 1.168.192.in-addr.arpa/IN: loaded serial 2005031801
Mar 18 08:41:21 mhost named[4121]: zone 255.in-addr.arpa/IN: loaded serial 42
Mar 18 08:41:21 mhost named[4121]: 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: loaded serial 1997022700
Mar 18 08:41:21 mhost named[4121]: zone testdomain.com/IN: loaded serial 2005031801
Mar 18 08:41:21 mhost named[4121]: zone localdomain/IN: loaded serial 42
Mar 18 08:41:21 mhost named[4121]: zone localhost/IN: loaded serial 42
Mar 18 08:41:21 mhost named[4121]: running
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 13574526
That all looks promising, so the fault must be elsewhere. Check your /etc/resolv.conf and /etc/nsswitch.conf your server should be using itself as a dns host.

Test what nameserversthe client computers are configured to look at.

On the server itself try ping mhost.testdomain.com

if that works try ping www.testdomain.com

Then try it on the clinets

0
 

Author Comment

by:linxcelent
ID: 13575134
Oh, I know what is wrong now. I forgot to change my DNS record to private ip address... Let me try that and I'll let you know how thing goes...

By the way, What does the /etc/nsswitch.com do?
0
 
LVL 5

Accepted Solution

by:
paranoidcookie earned 2000 total points
ID: 13575224
Several things but it determines the order of dns lookup useually

files hosts dns

Meaing it adns request will look at systems files then /etc/hosts then use dns to do a lookup.
0
 

Author Comment

by:linxcelent
ID: 13575462
I changed my DNS setting to my private IP address instead of public IP address. Now it's working just fine.

Thank you for all your help...
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 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