Setting nameservers for Centos 6 ( No control panel )

Status
Not open for further replies.

OlgaSecom

Member
15
2015
3
0
Its need to configure DNS server on the your server, like bind:
# yuminstall bind bind-utils

backup your bind config
# mv/etc/named.conf /etc/named.conf_backup

create and edit new config

# pico/etc/named.conf

and paste this config to the file:

###begin
options{
recursion no;
allow-query { any; };
allow-query-cache{ any; }
;
};
zone"yourdomain.com" {
type master;
file"/var/named/yourdomain.com";
};
###end



than you should create your domain zone file:


# pico/var/named/yourdomain.com


#dns zone begin
$TTL3600
yourdomain.com. IN SOA SKRS969.local. root.SKRS969.local.(2015021702 10800 3600 604800 86400)
yourdomain.com. IN NSns1.yourdomain.com.
yourdomain.com. IN NSns2.yourdomain.com.
yourdomain.com. IN MX 10mail.yourdomain.com.
yourdomain.com. IN A 12.34.56.78
ns1IN A 1.2.3.4
ns2 IN A 1.2.3.4
www IN CNAMEyourdomain.com.
mail IN A 5.6.7.8
#dns zone end


where1.2.3.4 - this server IP (dns server with bind)
5.6.7.8- your MX mail server IP
12.34.56.78- your webserver IP

orif dns, web and mail server are located on the same server - put oneIP

restart DNS bind service:

# /etc/init.d/namedrestart

Than you should registered name servers for your domain in your domain registration site (ns1.your domain.com 1.2.3.4 , ns2.yourdomain.com1.2.3.4) and than change NS for your domain to ns1.your domain.com andns2. yourdomain.com.

Beforechanging NS on registrator site you can check is your bind workproperly:

#dig@localhost yourdomain.com

youshould get something like:

;;ANSWER SECTION:
yourdomain.com.3600 IN A 1.2.3.4

;;AUTHORITY SECTION:
yourdomain.com.3600 IN NS ns1.yourdomain.com.
yourdomain.com.3600 IN NS ns2.yourdomain.com.

;;Query time: 10 msec
 
4 comments
Status
Not open for further replies.
Back
Top