Configurar un DNS Server (Minimo)

Page last edited hace 2181 días 2 horas
De Solaris-ES
Saltar a: navegación, buscar

Creamos el archivo named.conf[editar]

# vi /etc/named.conf
options {
  directory "/var/named";
  pid-file "/var/named/tmp/named.pid";
};

zone "."                       { type hint;    file "db.cache"; };
zone "0.0.127.in-addr.arpa"    { type master;  file "db.127.0.0"; };
zone "1.168.192.in-addr.arpa"  { type master;  file "db.192.168.1"; };
zone "mydomain"                { type master;  file "db.mydomain"; };

Creamos las zonas definidas anteriormente[editar]

# mkdir -p /var/named
# vi /var/named/db.127.0.0
$TTL 7200
@               IN      SOA     sol02.mydomain.       mobarrio.mydomain. (
                        2010122001 ; YYYYMMDDVV  ano mes dia version
                        3600 ; refresh
                        3600 ; retry
                        86400 ; expire
                        7200 ; default_ttl
                        )
                                IN      NS      sol02.mydomain.
1                               PTR     localhost.
# vi /var/named/db.192.168.1
$TTL 7200
@               IN      SOA     sol02.mydomain.       mobarrio.mydomain. (
                        2010122001 ; YYYYMMDDVV  ano mes dia version
                        3600 ; refresh
                        3600 ; retry
                        86400 ; expire
                        7200 ; default_ttl
                        )
                             IN      NS      sol02.mydomain.
66                           PTR             sol01.mydomain.
67                           PTR             sol02.mydomain.
# vi /var/named/db.mydomain
$TTL 7200
@               IN      SOA     sol02.mydomain.       mobarrio.mydomain. (
                        2010122001 ; YYYYMMDDVV  ano mes dia version
                        3600 ; refresh
                        3600 ; retry
                        86400 ; expire
                        7200 ; default_ttl
                        )
                                IN      NS      sol02.mydomain.
localhost                       IN      A       127.0.0.1
sol01                           IN      A       192.168.1.66
                                MX      10      sol01
sol02                           IN      A       192.168.1.67
                                MX      10      sol02
# vi /var/named/db.cache
;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC 
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    Jan 29, 2004
;       related version of root zone:   2004012900
;
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
;
; formerly C.PSI.NET
;
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; operated by VeriSign, Inc.
;
.                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
;
; operated by RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129 
;
; operated by ICANN
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; operated by WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File

Verificamos la configuración[editar]

# named-checkconf -z /etc/named.conf
  zone 0.0.127.in-addr.arpa/IN: loaded serial 2010122001
  zone 1.168.192.in-addr.arpa/IN: loaded serial 2010122001
  zone mydomain/IN: loaded serial 2010122001

Arrancamos el servicio[editar]

# svcadm enable dns/server