How to set dns in rhel4

Hi,

I would like to know on how to set up dns on my server running rhel 4, the purpose so other computers can look through this server(trial1) when they nslookup and so on..

I tried to put my server name(trial1) and ip address in /etc/resolv.conf but when I try on the other server to nslookup, it didnt succesful..
nb: this is only for my LAN only.. means, other pc or laptop or other machines can connect to this dns or reversable..

/etc/resolv.conf

search trial1
trial1 192.168.20.21

I thought by doin this it should allow other server to recoqnize my dns
sorry I'm quite new.. thanks in advance :slight_smile:

The 'search' directive of resolv.conf doesn't specify which servers to search, but what domains to search through. Example: if you specify two search domains

search bar.com
search foo.bar.com

and do a lookup for the name 'baz', the resolver will look for

Name servers, where the resolver should query about them, are specified by the 'nameserver' directive, eg

nameserver 192.168.0.2
nameserver 192.168.0.3

will query 192.168.0.2 first, and, if that's not reachable, 192.168.0.3.

For your server to be able to act as a name server, you'll have to install and configure the appropriate service. One of the most used is BIND, which should be available in the RHEL repositories.

Ref: resolv.conf(5), Wikipedia on BIND, ISC BIND

Redhat uses BIND (named) for DNS. There are essentially three types of DNS servers:

  • caching nameserver
  • slave nameserver
  • master nameserver

You need to decide which one is appropriate for your particular setup.

Further information is available here: RHEL4 - Berkeley Internet Name Domain

hi, thank you for your replied..

I want to setup for our local project only which is for LAN network only.. which other pc can look at my server and other machines/servers can look to this server or reversable.. can you guide me on how to setup this? I have named.conf installed on my server.. sorry I'm quite new to this, I have looked through the document or articles on internet but somehow its quite confusing.. maybe this will be a good start for others as well.. I will post this to my blog to teach other persons when I able to set this by myself..

once again thank you for your response and help for me.. appreciate it!!!

---------- Post updated 10-26-09 at 11:11 AM ---------- Previous update was 10-25-09 at 11:07 PM ----------

hi, btw this is my /etc/named.conf file.. what I do really want is other servers or pc's can look to this server.. or this server can look to other servers.. lets say I name my server trial1, trial2, trial3, trial4.. I want them can look or resolve each other if it's possible. I guess 1 server must be a master while the rest are slaves

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

---------- Post updated at 01:28 PM ---------- Previous update was at 11:11 AM ----------

lets say the name of this server is trial1, I tried to do nslookup from this trial1 server whether it will give a response.. below is my config and details

#/etc/init.d/named start [ok]

#ps -ef | grep named
named 19510 1 0 10:42 ? 00:00:02 /usr/sbin/named -u named -t /var/named/chroot

#cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.20.21 trial1

#cat /etc/resolv.conf
search trial1
nameserver 192.168.20.21

#nslookup trial1
Server: 192.168.20.21
Address: 192.168.20.21#53

** server can't find trial1: SERVFAIL

---------- Post updated at 05:35 PM ---------- Previous update was at 01:28 PM ----------

I have modified the zone and somehow able to nslookup my trial1 server.. I name the trial1 server as server.trial1.com
and I changed the zone name to server.trial1.com and modified the ipaddress inside..

the question is.. if I am using the other servers lets say TRIAL2, how can I make this trial2 to nslookup trial1?
because I tried that but it was not able to.. sigh* I have no one to guide me through this :frowning:

No, you want one system to be a master, possibly another system to be a slave, and all other systems /etc/resolv.conf should point to both the master and slave.