WHAT IS DNS?
It is the name resolution protocol for TCP/IP networks, such as the Internet. A DNS server hosts information that allows client computers to resolve easy-to-remember alphanumeric DNS names to the IP addresses that computers use to communicate with each other.
DNS domain type
TOP LEVEL DOMAIN: A two- or three-letter name used to indicate a country, region, or the type of organization that uses a name: ( ANDexample: “.com” )
SECOND LEVEL DOMAIN: Variable length registered name that an individual or organization uses and the Internet. These names are always based on an appropriate top-level domain, depending on the type of organization or geographic location where the name is used. (EXAMPLE: “NETWORK-ORBITA.”)
SUBDOMAIN: Additional names that an organization can create derived from the second-level registered domain name. These include names added to develop the DNS name tree into an organization and divide it into departments or geographic locations. (EXAMPLE: “ROKITOH.RED-ORBITA.COM”)
Configure static addressing
To do this, first we are going to configure a static addressing.
The network card configuration files are located in: /etc/sysconfig/network-scripts/
We access the folder:
[rokitoh@red.orbita.com~] # cd /etc/sysconfig/network-scripts/we configure the file ifcfg-eth0 which is where the information is found
[rokitoh@red.orbita.com network-scripts] # nano ifcfg-eth0y alli lo configuramos:
DEVICE=eth0
BOOTPROTO=static #configuración estatica
BROADCAST=192.168.1.255 #dirección de broadcast
HWADDR=05:02:4A:5C:EE:9F # Dirección MAC
IPADDR= 192.168.1.150 # Ip de la interfaz de red
NETMASK= 255.255.255.0 # Máscara de red
NETWORK= 192.168.1.0 # Red en la que se encuentra
ONBOOT=yes # Arranque automático al inicio del sistema
HOSTNAME=dns1.redorbita.local
GATEWAY= 192.168.1.1 # Puerta de enlace
TYPE=EthernetConfigure the /etc/hosts file
We access the directory
[rokitoh@red.orbita.com~] nano /etc/hostswe add the addressing of our IP
# Do not remove the following line, or various programas
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.150 dns1.redorbita.local dns1
::1 localhost6.localdomain6 localhost6Configuring the /etc/sysconfig/network file
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=dns1.redorbita.local>Configuring the file /etc/resolv.conf
[rokitoh@red.orbita.com~] nano /etc/resolv.conf
We add our domain and the IP address of the DNS server
search redorbita.com
nameserver 192.168.1.150
We restart the network:
[rokitoh@red.orbita.com~] # /etc/init.d/network restartWe verify that the changes have been made:
[rokitoh@red.orbita.com~] # sbin/ifconfigInstall and configure Bind9
[rokitoh@red.orbita.com~] yum install bind bind-utils bind-libs bind-chroot caching-nameserver
Configure the zone file[rokitoh@red.orbita.com~] cd /var/named/chroot/var/named/[rokitoh@red.orbita.com named] cp named.zone redorbita.local.zone$TTL 1W
@ IN SOA dns1.redorbita.local. root.redorbita.local (
2 ; Serial Number
1W ; Time To Refresh
1D ; Time To Retry
28D ; Time To Expire
1W ) ; Negative Cache TTL
@ IN NS dns1 #Nombre del servidor DNS
@ IN A 192.168.1.150 #IP servidor DNS HOST
dns1 IN A 192.168.1.150
www IN A redorbita.local #Nombre servidor web[rokitoh@red.orbita.com named] cp named.local 1.168.192.in-addr.arpa.zone[rokitoh@red.orbita.com named] nano 1.168.192.in-addr.arpa.zone$TTL 1W
@ IN SOA dns1.redorbita.local. root.redorbita.local (
2 ; Serial Number
1W ; Time To Refresh
1D ; Time To Retry
28D ; Time To Expire
1W ) ; Negative Cache TTL
@ IN NS dns1,redorbita.local
150 IN PTR dns1.redorbita.local[rokitoh@red.orbita.com etc] cd /var/named/chroot/etcWe create the file:
[rokitoh@red.orbita.com etc] touch named.confOnce created make sure to add the following owners
[rokitoh@red.orbita.com etc] chown root:named named.confNow we are going to configure the created file "named.conf"
[rokitoh@red.orbita.com etc] nano named.confWe add the following:
options { directory «/var/named/»; dump-file «/var/named/data/cache_dump.db»; statistics-file «/var/named/data/named_stats.txt»; allow-recursion { 127.0.0.1; 192.168.1.0/24; }; forwarders { 200.33.146.209; 200.33.146.217; }; forward first; }; zone «.» { type hint; file «named.ca»; }; zone «localhost» { type master; file «localhost.zone»; allow-update { none; }; }; zone «redorbita.local» { type master; file «redorbita.local.zone»; allow-update { none; }; }; zone «1.168.192.in-addr.arpa» { type master; file «1.168.192.in-addr.arpa.zone»; allow-update { none; }; };We restart the service.
/etc/init.d/named restart Deteniendo named: [OK] Iniciando named: [OK]To verify that bind is loading the zones, we must execute the following command
[rokitoh@red.orbita.com etc] tail -80 /var/log/messages | grep namedWe verify that everything has gone well:
[rokitoh@red.orbita.com etc] host redorbita.local 192.168.1.150 [rokitoh@red.orbita.com etc] dig @192.168.1.150 redorbita.local [rokitoh@red.orbita.com etc] dig @192.168.1.150 redorbita.local NS
Well, we have already finished the installation and configuration of a DNS server in CentOS 5.5, I hope it has been helpful to you,Regards, rokitoh
Comments