bind installation on centos
TRANSCRIPT
-
8/2/2019 BIND Installation on CentOS
1/6
BIND Installation On CentOS
By Rhesa Mahendra
Published: 2010-03-16 15:29
BIND Installation On CentOSWhat is bind?BIND is alternative software for translating domain names into IPaddresses. Because domain names are alphabetic, they are easier toremember. So if wewill browse the Internet we don(TM)t need toremember IP addresses. For example, the domain name www.yourdomain.com mighttranslate to 192.168.0.1
.
1. You Can Check BIND Packet
[root@server named]# rpm -qa
bind*
bind-libs-9.2.4-2
bind-utils-9.2.4-2
bind-9.2.4-2
2. Setting Computer NS1 With IP 192.168.0.1 As Nameserver And Domain Name yourdomain.com
[root@server ~]# cat /etc/resolv.conf
nameserver192.168.0.1
3. Setting File /etc/named.conf
[root@server ~]# nano /etc/named.conf
Copyright (c) 2012 Permission is granted to copy, distribute and/or modify the content ofthis page under the terms of the GNU Free Documentation License, Version 1.2or any later version published by the Free Software Foundation; withHowtoForge Page 1 of 6
-
8/2/2019 BIND Installation on CentOS
2/6
BIND Installation On CentOS http://www.howtoforge.com/
//
// 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 "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "yourdomain.com" IN {
type master;
file "/var/named/yourdomain.com.zone";
Copyright (c) 2012 Permission is granted to copy, distribute and/or modify the content ofthis page under the terms of the GNU Free Documentation License, Version 1.2or any later version published by the Free Software Foundation; withHowtoForge Page 2 of 6
-
8/2/2019 BIND Installation on CentOS
3/6
BIND Installation On CentOS http://www.howtoforge.com/
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "/var/named/0.168.192.rev";
allow-update { none; };
};
include "/etc/rndc.key";
4. Setting File /var/named/yourdomain.com.zone
First you must create the file yourdomain.com.zone; you can use thissyntax:
[root@server ~]# nano
/var/named/yourdomain.com.zone
$TTL 86400
@ IN SOA yourdomain.com. root.yourdomain.com. (
100 ; serial
1H ; refresh
1M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS ns1.yourdomain.com.
@ IN A 192.168.0.1
ns1 IN A 192.168.0.1
@ IN MX 10 mail.yourdomain.com.
mail IN A 192.168.0.1
WWW IN A 192.168.0.1
Copyright (c) 2012 Permission is granted to copy, distribute and/or modify the content ofthis page under the terms of the GNU Free Documentation License, Version 1.2or any later version published by the Free Software Foundation; with no InvariHowtoForge Page 3 of 6
-
8/2/2019 BIND Installation on CentOS
4/6
BIND Installation On CentOS http://www.howtoforge.com/
5. Setting File /var/named/0.168.192.rev
First you must create the file 0.168.192.rev; you can use thissyntax:
[root@server ~]# nano /var/named/0.168.192.rev
$TTL 86400
@ IN SOA yourdomain.com. root.yourdomain.com. (
100 ; serial
1H ; refresh
1M ; retry
1W ; expiry
1D) ; minimum
@ IN NS ns1.yourdomain.com.
1 IN PTR binggo.yourdomain.com.
6. nslookupyourdomain.com
[root@server ~]#
nslookup yourdomain.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: yourdomain.com
Address: 192.168.0.1
7. dig yourdomain.com
[root@server ~]# dig yourdomain.com
Copyright (c) 2012 Permission is granted to copy, distribute and/or modify the content ofthis page under the terms of the GNU Free Documentation License, Version 1.2or any later version published by the Free Software Foundation; with no InvariHowtoForge Page 4 of 6
-
8/2/2019 BIND Installation on CentOS
5/6
BIND Installation On CentOS http://www.howtoforge.com/
; DiG 9.2.4 yourdomain.com
;;global options: printcmd
;; Got answer:
;; ->>HEADER
-
8/2/2019 BIND Installation on CentOS
6/6
BIND Installation On CentOS http://www.howtoforge.com/
mode of `/var/named/data(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/named.local(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/named.ca(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/named.ip6.local(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/localdomain.zone(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/yourdomain.com.zone(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/named.broadcast(TM) changed to 0777 (rwxrwxrwx)
mode of `/var/named/slaves(TM) changed to 0777 (rwxrwxrwx)
9. Check The /var/log/messages Log To Find Out If There Are Errors
[root@server ~]# tail
/var/log/messages
Aug 2 10:53:57 server named[20094]: listening on IPv4 interface venet0:0, 192.168.0.1#53
Aug 2 10:53:57 server named[20094]: command channel listening on 127.0.0.1#953
Aug 2 10:53:57 server named[20094]: zone 0.168.192.in-addr.arpa/IN: loaded serial 100
Aug 2 10:53:57 server named[20094]: zone yourdomain.com/IN: loaded serial 100
Aug 2 10:53:57 server named[20094]: zone localhost/IN: loaded serial 42
Aug 2 10:53:57 server named[20094]: running
Aug 2 10:53:57 server named[20094]: zone yourdomain.com/IN: sending notifies (serial 100)
Aug 2 10:53:57 server named[20094]: zone 0.168.192.in-addr.arpa/IN: sending notifies (serial 100)
Aug 2 10:53:57 server named[20094]: received notify for zoneyourdomain.com(TM)
Aug 2 10:53:57 server named[20094]: received notify for zone 0.168.192.in-addr.arpa(TM)
Copyright (c) 2012 Permission is granted to copy, distribute and/or modify the content ofthis page under the terms of the GNU Free Documentation License, Version 1.2or any later version published by the Free Software Foundation; with no InvariHowtoForge Page 6 of 6