gopigops
asked on
configure dns in redhat linux 5
I have configured dns server in redhat.but unable to relolve dns name.
I am not sure how to edit the named.conf. pls give me a step-by-step dns configuration
I am not sure how to edit the named.conf. pls give me a step-by-step dns configuration
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch18_:_Configuring_DNS
ASKER
ya i know this site, because this site is used to configure before.
I did before:
1.install bind* and cachingserver
2.cd /var/named/chroot/etc then copy the named.caching to named.conf and edit the file
listening port, forward zone and reverse zone.
3.copy the local.domain as mydomain.zone and edit every think ok,but unable to resolve any hostnames.
pls give me a step-by-step..
I did before:
1.install bind* and cachingserver
2.cd /var/named/chroot/etc then copy the named.caching to named.conf and edit the file
listening port, forward zone and reverse zone.
3.copy the local.domain as mydomain.zone and edit every think ok,but unable to resolve any hostnames.
pls give me a step-by-step..
Unable to resolve hostnames inside mydomain.zone? Or public names?
Chris
ASKER
yes inside mydomain.zone.
Inside named.conf you should have an entry like this:
zone "mydomain.zone" {
type master;
file "mydomain.zone.dns";
}
Is that correct?
If BIND is failing to load the file listed it will throw an error into /var/log/messages. Is there anything there?
Chris
ASKER
ya i have an entry like this.
Okay, so if that's there, and if the zone is loaded you should be able to resolve names, at the very least these:
dig mydomain.zone soa @localhost
dig mydomain.zone ns @localhost
What kind of response do you get? Timeout? Refused? NXDOMAIN?
Chris
What's in your /etc/resolv.conf file? Are you pointing nameserver at the ip address of the localhost server?
I think you need to be set up as a DNS client as well as a server.
I think you need to be set up as a DNS client as well as a server.
hai i am giving you a step by step to configure DNS
DNS=Domain Name Server
----------------------
HOST NAME ASSIGNING:
add entry in
vi /etc/sysconfig/network
like
NETWORKING=yes
HOSTNAME=server1.mazenet.c om
and
vi /etc/hosts
like
127.0.0.1 localhost.localdomain localhost
192.168.0.23 server1.maenet.com server1
and
vi /etc/resolv.conf
change
nameserver 192.168.0.23 # this system ip{dns system ip}
-------------------------- ---------- ---------- ---------- ---------- ---
1) FORWARD LOOKUP:
---------------
INSTALL THE RPMS:
rpm -ivh ftp://192.168.0.254/pub/Server/bind* --force
rpm -ivh ftp://192.168.0.254/pub/Server/cachingnameserver* --force
rpm -qa | grep bind
bind-utils-9.2.4-2
bind-libs-9.2.4-2
bind-9.2.4-2
bind-devel-9.2.4-2
bind-chroot-9.2.4-2
caching-nameserver-7.3-3
-------------------------- ---------- ---------- ---------- ---
GO TO FILE
/var/named/chroot/etc/name d.conf[if the file not exist go to that directory]
cd /var/named/chroot/etc
mv named.cachingnameserver.co nf named.conf
to edit go to file:
named.conf
change the entries:
listern port 53 {192.168.0.0/24;};
allow-query { localhost;192.168.0.0/24; };
match-clients { localhost;192.168.0.0/24; };
match-destinations { localhost;192.168.0.0/24; };
# you can configure for your own network
go to file:
named.rfc1912.zones
add entry like:
zone "mazenet.com" IN {
type master;
file "mazenet.zone";
allow-update { none; };
};
-------------------------- ---------- ---------- ---------- ----
service named restart
named-checkconf /var/named/chroot/etc/name d.conf
these commands shouldn't show errors, if means your named.conf file have some errors.
-------------------------- ---------- ---------- ---------- -----
CREATE A NEW FILE
vi /var/named/chroot/var/name d/mazenet. zone # same as previously defind
add a entries like
$TTL 86400
mazenet.com. IN SOA server1.mazenet.com. root.server1.mazenet.com. (
2003040100 ; serial number
1H ; refresh slave
5M ; retry query
1W ; expire
1M ; negative TTL
)
@ IN NS server1.mazenet.com.
server1.mazenet.com. IN A 192.168.0.23
@ IN MX 10 server1.mazenet.com.
mail.mazenet.com. 3600 IN CNAME server1.mazenet.com.
www IN A 192.168.0.23
-------------------------- ---------- ---------- ---------- ---------- --
check the group name of database file:
ll -Z /var/named/chroot/var/name d/mazenet. zone
if the file contains group name of root means change that to named by using next command:
chgrp named /var/named/chroot/var/name d/mazenet. zone
-------------------------- ---------- ---------- ---------- ---------- -----
service named restart
named-checkconf /var/named/chroot/etc/name d.conf
these commands shouldn't show errors, if means your named.conf file have some errors.
named-checkzone mazenet.com /var/named/chroot/var/name d/mazenet. zone
if have any errors check this file.
-------------------------- ---------- ---------- ---------- ----------
add that service permanently
chkconfig named on
-------------------------- ---------- ---------- ---------- ----------
CHECKING
dig server1.mazenet.com
nslookup server1.mazenet.com
host server1.examlpe.com
-------------------------- ---------- ---------- ---------- ---------- ---
names:
IN- internet
SOA-sort of authority
NS-name server
A-address
CNAME-canonical name
PTR-pointer record
ARPA-advanced research project ajency
TTL-time to live
-------------------------- ---------- ---------- ---------- ---------- -------
2) BACKWARD LOOKUP:
--------------------
DNS----- DOMAIN NAME SERVER-backward lookup
INSTALL THE RPMS:
bind-utils-9.2.4-2
bind-libs-9.2.4-2
bind-9.2.4-2
bind-devel-9.2.4-2
bind-chroot-9.2.4-2
caching-nameserver-7.3-3
-------------------------- ---------- ---------- ---------- ---
GO TO FILE
/var/named/chroot/etc/name d.conf
add entry like
zone "0.168.192.in-addr.arpa" IN {
type master;
file "mazenet.zone.rev";
allow-update { none; };
};
-------------------------- ---------- ---------- ---------- ----
service named restart
named-checkconf /var/named/chroot/etc/name d.conf
these commands shouldn't show errors, if means your named.conf file have some errors.
-------------------------- ---------- ---------- ---------- -----
CREATE A NEW FILE
vi /var/named/chroot/var/name d/mazenet. zone.rev # same as previously defind
add a entries like
$TTL 86400 ; 1 Day ( we could have used 1D )
0.168.192.IN-ADDR.ARPA. IN SOA server1.mazenet.com. root.server1.mazenet.com.(
2003040100 ; serial number
1H ; refresh slave
5M ; retry query
1W ; expire
1M ; negative TTL
)
@ IN NS server1.mazenet.com.
23.0.168.192.IN-ADDR.ARPA. IN PTR server1.mazenet.com.
-------------------------- ---------- ---------- ---------- ---------- --
service named restart
named-checkzone 0.168.192.in-addr.arpa /var/named/chroot/var/name d/mazenet. zone.rev
if have any errors check this file.
-------------------------- ---------- ---------- ---------- ----------
add that service permanently
chkconfig named on
-------------------------- ---------- ---------- ---------- ----------
CHECKING
dig -x 192.168.0.23
nslookup 192.168.0.23
host 192.168.0.23
-------------------------- ---------- ---------- ---------- ---------- ---
names:
IN- internet
SOA-sort of authority
NS-name server
A-address
CNAME-canonical name
PTR-pointer record
ARPA-advanced research project ajency
TTL-time to live
-------------------------- ---------- ---------- ---------- ---------- ---------- --
DNS=Domain Name Server
----------------------
HOST NAME ASSIGNING:
add entry in
vi /etc/sysconfig/network
like
NETWORKING=yes
HOSTNAME=server1.mazenet.c
and
vi /etc/hosts
like
127.0.0.1 localhost.localdomain localhost
192.168.0.23 server1.maenet.com server1
and
vi /etc/resolv.conf
change
nameserver 192.168.0.23 # this system ip{dns system ip}
--------------------------
1) FORWARD LOOKUP:
---------------
INSTALL THE RPMS:
rpm -ivh ftp://192.168.0.254/pub/Server/bind* --force
rpm -ivh ftp://192.168.0.254/pub/Server/cachingnameserver* --force
rpm -qa | grep bind
bind-utils-9.2.4-2
bind-libs-9.2.4-2
bind-9.2.4-2
bind-devel-9.2.4-2
bind-chroot-9.2.4-2
caching-nameserver-7.3-3
--------------------------
GO TO FILE
/var/named/chroot/etc/name
cd /var/named/chroot/etc
mv named.cachingnameserver.co
to edit go to file:
named.conf
change the entries:
listern port 53 {192.168.0.0/24;};
allow-query { localhost;192.168.0.0/24; };
match-clients { localhost;192.168.0.0/24; };
match-destinations { localhost;192.168.0.0/24; };
# you can configure for your own network
go to file:
named.rfc1912.zones
add entry like:
zone "mazenet.com" IN {
type master;
file "mazenet.zone";
allow-update { none; };
};
--------------------------
service named restart
named-checkconf /var/named/chroot/etc/name
these commands shouldn't show errors, if means your named.conf file have some errors.
--------------------------
CREATE A NEW FILE
vi /var/named/chroot/var/name
add a entries like
$TTL 86400
mazenet.com. IN SOA server1.mazenet.com. root.server1.mazenet.com. (
2003040100 ; serial number
1H ; refresh slave
5M ; retry query
1W ; expire
1M ; negative TTL
)
@ IN NS server1.mazenet.com.
server1.mazenet.com. IN A 192.168.0.23
@ IN MX 10 server1.mazenet.com.
mail.mazenet.com. 3600 IN CNAME server1.mazenet.com.
www IN A 192.168.0.23
--------------------------
check the group name of database file:
ll -Z /var/named/chroot/var/name
if the file contains group name of root means change that to named by using next command:
chgrp named /var/named/chroot/var/name
--------------------------
service named restart
named-checkconf /var/named/chroot/etc/name
these commands shouldn't show errors, if means your named.conf file have some errors.
named-checkzone mazenet.com /var/named/chroot/var/name
if have any errors check this file.
--------------------------
add that service permanently
chkconfig named on
--------------------------
CHECKING
dig server1.mazenet.com
nslookup server1.mazenet.com
host server1.examlpe.com
--------------------------
names:
IN- internet
SOA-sort of authority
NS-name server
A-address
CNAME-canonical name
PTR-pointer record
ARPA-advanced research project ajency
TTL-time to live
--------------------------
2) BACKWARD LOOKUP:
--------------------
DNS----- DOMAIN NAME SERVER-backward lookup
INSTALL THE RPMS:
bind-utils-9.2.4-2
bind-libs-9.2.4-2
bind-9.2.4-2
bind-devel-9.2.4-2
bind-chroot-9.2.4-2
caching-nameserver-7.3-3
--------------------------
GO TO FILE
/var/named/chroot/etc/name
add entry like
zone "0.168.192.in-addr.arpa" IN {
type master;
file "mazenet.zone.rev";
allow-update { none; };
};
--------------------------
service named restart
named-checkconf /var/named/chroot/etc/name
these commands shouldn't show errors, if means your named.conf file have some errors.
--------------------------
CREATE A NEW FILE
vi /var/named/chroot/var/name
add a entries like
$TTL 86400 ; 1 Day ( we could have used 1D )
0.168.192.IN-ADDR.ARPA. IN SOA server1.mazenet.com. root.server1.mazenet.com.(
2003040100 ; serial number
1H ; refresh slave
5M ; retry query
1W ; expire
1M ; negative TTL
)
@ IN NS server1.mazenet.com.
23.0.168.192.IN-ADDR.ARPA.
--------------------------
service named restart
named-checkzone 0.168.192.in-addr.arpa /var/named/chroot/var/name
if have any errors check this file.
--------------------------
add that service permanently
chkconfig named on
--------------------------
CHECKING
dig -x 192.168.0.23
nslookup 192.168.0.23
host 192.168.0.23
--------------------------
names:
IN- internet
SOA-sort of authority
NS-name server
A-address
CNAME-canonical name
PTR-pointer record
ARPA-advanced research project ajency
TTL-time to live
--------------------------
ASKER
Hi expert,
In this above configuration done ,After issued the host gopi.net.com, the error was Host gopi.net.com not found: 3(NXDOMAIN)
In this above configuration done ,After issued the host gopi.net.com, the error was Host gopi.net.com not found: 3(NXDOMAIN)
You're going to have to show us your configuration and zone files.
Chris
ASKER
options {
listen-on port 53 { 192.168.1.230; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dum p.db";
statistics-file "/var/named/data/named_sta ts.txt";
memstatistics-file "/var/named/data/named_mem _stats.txt ";
query-source port 53;
query-source-v6 port 53;
allow-query { localhost; 192.168.1.0/24; };
view localhost_resolver {
match-clients { localhost; 192.168.1.0/24; };
match-destinations { localhost; 192.168.1.0/24; };
};
zone "net.com" IN {
type master;
file "net.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "net.zone.rev";
allow-update { none; };
forward zone file:
$TTL 86400
net.com. IN SOA gopi.net.com. root.gopi.net.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ; minimum
)
@ IN NS gopi.net.com.
gopi.net.com IN A 192.168.1.230
client1.net.com IN A 192.168.1.231
client2.net.com IN A 192.168.1.232
Reversezone file:
$TTL 86400
1.168.192.IN-ADDR-ARPA. IN SOA gopi.net.com. root.gopi.net.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ; Minimum
)
@ IN NS gopi.net.com.
230.1.168.192.IN-ADDR-ARPA . IN PTR gopi.net.com.
231.1.168.192.IN-ADDR-ARPA . IN PTR client1.net.com.
232.1.168.192.IN-ADDR-ARPA . IN PTR client2.net.com.
listen-on port 53 { 192.168.1.230; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dum
statistics-file "/var/named/data/named_sta
memstatistics-file "/var/named/data/named_mem
query-source port 53;
query-source-v6 port 53;
allow-query { localhost; 192.168.1.0/24; };
view localhost_resolver {
match-clients { localhost; 192.168.1.0/24; };
match-destinations { localhost; 192.168.1.0/24; };
};
zone "net.com" IN {
type master;
file "net.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "net.zone.rev";
allow-update { none; };
forward zone file:
$TTL 86400
net.com. IN SOA gopi.net.com. root.gopi.net.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ; minimum
)
@ IN NS gopi.net.com.
gopi.net.com IN A 192.168.1.230
client1.net.com IN A 192.168.1.231
client2.net.com IN A 192.168.1.232
Reversezone file:
$TTL 86400
1.168.192.IN-ADDR-ARPA. IN SOA gopi.net.com. root.gopi.net.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ; Minimum
)
@ IN NS gopi.net.com.
230.1.168.192.IN-ADDR-ARPA
231.1.168.192.IN-ADDR-ARPA
232.1.168.192.IN-ADDR-ARPA
Hmm okay... What you have is this...
Zone Name: net.com
Which contains the following Host Records:
gopi.net.com.net.com
client1.net.com.net.com
client2.net.com.net.com
The second "net.com" is included because you used relative (not-terminated) names. If you want to use gopi, client1 and client2 as Host Names within the zone you must use one of the two examples below:
gopi.net.com. IN A 192.168.1.230
client1.net.com. IN A 192.168.1.231
client2.net.com. IN A 192.168.1.232
Or:
gopi IN A 192.168.1.230
client1 IN A 192.168.1.231
client2 IN A 192.168.1.232
If you do not terminate a name the current zone name will be appended when the zone loads. Because it's less typing / clutter I suggest you use the second of these two examples.
Chris
ASKER
the error was like same..
You updated the serial and restarted named?
Chris
ASKER
ya updated and restarted.
Which change did you go for? And can you check /var/log/messages, make sure it loaded the zone correctly.
Chris
ASKER
Jan 2 07:35:53 gopi named[9947]: found 1 CPU, using 1 worker thread
Jan 2 07:35:53 gopi named[9947]: loading configuration from '/etc/named.conf'
Jan 2 07:35:53 gopi named[9947]: /etc/named.conf:46: when using 'view' statements
, all zones must be in views
Jan 2 07:35:53 gopi named[9947]: listening on IPv6 interface lo, ::1#53
Jan 2 07:35:53 gopi named[9947]: listening on IPv4 interface eth0, 192.168.1.230#
53
Jan 2 07:35:53 gopi named[9947]: command channel listening on 127.0.0.1#953
Jan 2 07:35:53 gopi named[9947]: command channel listening on ::1#953
Jan 2 07:35:53 gopi named[9947]: zone 0.in-addr.arpa/IN/localhos t_resolver : loade
d serial 42
Jan 2 07:35:53 gopi named[9947]: zone 0.0.127.in-addr.arpa/IN/lo calhost_re solver:
loaded serial 1997022700
Jan 2 07:35:53 gopi named[9947]: zone 255.in-addr.arpa/IN/localh ost_resolv er: loa
ded serial 42
Jan 2 07:35:53 gopi named[9947]: 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.arp a/IN/local host_resol ver: loaded serial 1997022700
Jan 2 07:35:53 gopi named[9947]: zone localdomain/IN/localhost_r esolver: loaded s
erial 42
Jan 2 07:35:53 gopi named[9947]: running
(END)
Jan 2 07:35:53 gopi named[9947]: loading configuration from '/etc/named.conf'
Jan 2 07:35:53 gopi named[9947]: /etc/named.conf:46: when using 'view' statements
, all zones must be in views
Jan 2 07:35:53 gopi named[9947]: listening on IPv6 interface lo, ::1#53
Jan 2 07:35:53 gopi named[9947]: listening on IPv4 interface eth0, 192.168.1.230#
53
Jan 2 07:35:53 gopi named[9947]: command channel listening on 127.0.0.1#953
Jan 2 07:35:53 gopi named[9947]: command channel listening on ::1#953
Jan 2 07:35:53 gopi named[9947]: zone 0.in-addr.arpa/IN/localhos
d serial 42
Jan 2 07:35:53 gopi named[9947]: zone 0.0.127.in-addr.arpa/IN/lo
loaded serial 1997022700
Jan 2 07:35:53 gopi named[9947]: zone 255.in-addr.arpa/IN/localh
ded serial 42
Jan 2 07:35:53 gopi named[9947]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.
.0.0.0.0.0.0.0.0.0.ip6.arp
Jan 2 07:35:53 gopi named[9947]: zone localdomain/IN/localhost_r
erial 42
Jan 2 07:35:53 gopi named[9947]: running
(END)
Fix this:
Jan 2 07:35:53 gopi named[9947]: /etc/named.conf:46: when using 'view' statements, all zones must be in views
I can't see any notice about it loading any of your zones, I suspect it's giving up after encountering view.
Chris
ASKER
how to fix this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear,
Ya thank you now dns is working fine.I am a new user of experts-exchange.your support is very well and any way thank you for your co-operation.
Ya thank you now dns is working fine.I am a new user of experts-exchange.your support is very well and any way thank you for your co-operation.
ASKER
your support is very well.your suppor is very used for us
Thank you Advance in future suppor.
Thank you Advance in future suppor.