How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VPS??

General support questions
Post Reply
tedybear
Posts: 9
Joined: 2014/04/08 05:07:56

How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VPS??

Post by tedybear » 2014/04/18 06:15:26

Hi, I am trying to setup BIND version 9.8.2 on webmin, but My Domain is not resolving for 3 days. I was searching any tutorial how to setup bindDNS Server but it still does work at My VPS Server. :oops: Can you help me?

Here is /etc/named.conf

Operating System : CentOS 6.5 64bit VPS
Hostname : dedeobi.com
IP Address : 103.27.207.136
Name server : ns1.dedeobi.com
Name server : ns2.dedeobi.com


//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
listen-on port 53 { 127.0.0.1; 103.27.207.136;};
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 103.27.207.0/24; };
allow-transfer { localhost; 103.27.207.136; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
auth-nxdomain no;
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "dedeobi.com" {
type master;
file "/var/named/dedeobi.com.hosts";
};
zone "207.27.103.in-addr.arpa" {
type master;
file "/var/named/103.27.207.rev";
};


==============================================================================================

My /var/named/dedeobi.com.hosts
$TTL 86400
@ IN SOA dedeobi.com. dedeobi.thegold.asia. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)

@ IN NS ns1.dedeobi.com.
@ IN NS ns2.dedeobi.com.

@ IN A 103.27.207.136
@ IN A 103.27.207.136
@ IN A 103.27.207.136

ns1 IN A 103.27.207.136
ns2 IN A 103.27.207.136
client IN A 103.27.207.136
========================================================================================
My /var/named/103.27.207.rev

$TTL 86400
@ IN SOA dedeobi.com. dedeobi.thegold.asia. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)

@ IN NS ns1.dedeobi.com.
@ IN NS ns2.dedeobi.com.
@ IN PTR dedeobi.com.

ns1 IN A 103.27.207.136
ns2 IN A 103.27.207.136
client IN A 103.27.207.136

136 IN PTR ns1.dedeobi.com.
136 IN PTR ns2.dedeobi.com.
136 IN PTR client.dedeobi.com.
========================================================================================
Linux Firewall:
Accept If protocol is UDP and destination port is 53 and state of connection is NEW
Accept If protocol is TCP and destination port is 53 and state of connection is NEW
========================================================================================
My /etc/resolv.conf

search dedeobi.com
nameserver 103.27.207.136
nameserver 103.27.207.136
nameserver 8.8.8.8
========================================================================================

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by avij » 2014/04/18 12:10:20

You have lots of oddities in there which I'm not going into right now, but try adding allow-query { any; }; to the 'zone "dedeobi.com"' section.

McLinux
Posts: 6
Joined: 2014/04/16 13:00:51

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by McLinux » 2014/04/18 12:33:58

If this is a new configuration, you need to advance the index else the caching nameservers will see same index number and not update.

Try changing

"2011071001 ;Serial"

to something like

"2014041801 ;Serial"

Note: the format above uses date in form YYYYMMDD plus a two digit identifier. This format allows for up to 99 dns changes in a single day, (the protocol only allows for a total of ten digits). If you need to make more than 99 changes per day...then maybe DNS admin is not a good career choice... ;)

tedybear
Posts: 9
Joined: 2014/04/08 05:07:56

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by tedybear » 2014/04/18 12:46:25

avij wrote:You have lots of oddities in there which I'm not going into right now, but try adding allow-query { any; }; to the 'zone "dedeobi.com"' section.
What are oddities which you mean?

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by avij » 2014/04/18 13:54:45

"dig @ns1.dedeobi.com client.dedeobi.com" seems to work now, good.

As for the oddities.. Well, first of all, you should have two separate name servers for your domain, preferably on different networks. ns1 and ns2 point to the same IP.

Why have you set "allow-query { localhost; 103.27.207.0/24; };" ? Note that if you change this, you may want to limit how your server handles recursive queries for other domains with an "allow-recursion { localhost; };"

zone "207.27.103.in-addr.arpa" is (almost) useless. You will need to set the reverse DNS name for your IP through your ISP. Setting it locally only affects how your own server handles the reverse DNS for all servers in the 103.27.207.x network. It does not affect how the rest of the world handles the reverse DNS for your IP address.

Yes, as pointed out in the above message, the serial number should be incremented each time you make a change to the zone file. It is common to follow the YYYYMMDDnn convention.

You have three "@ IN A 103.27.207.136" lines in your zone file. One would suffice.

"@ IN PTR dedeobi.com." in your reverse DNS file looks dubious. I also wouldn't have the same IP address to point to three different names.

Having two "nameserver 103.27.207.136" rows in /etc/resolv.conf is unnecessary.

Most of these don't really affect how your name server works, but cleaning these up would look a bit more professional.

tedybear
Posts: 9
Joined: 2014/04/08 05:07:56

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by tedybear » 2014/04/21 03:51:41

I have already fixed some miss configuration and followed what your suggesstion on this thread.
I used webmin to generate my dns server configuration, so Iam shocked because there're lot mistake if I used default generate from webmin configuration.

My next question is:

I have 5 domain, and I woud like to use ns1.dedeobi.com and ns2.dedeobi.com for those domains.
I was trying to configure one of my domains name is muizzagroup.com.

When I try to access to muizzagroup.com, what I get from browser is dedeobi.com.
I try to access IP http://103.27.207.136/ from browser and it shows dedeobi.com

So how to configure BindDNS Server for multiple domain, and multiple website? And I would like to use My DNS server ns1.dedeobi.com and ns2.dedeobi.com for All DNS server my 5 domains.


Sorry I am newbie in SysAdmin.

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by avij » 2014/04/21 08:31:44

The term you should be searching for is name-based virtual hosts. I have no idea how these are handled in webmin. This forum is not a webmin support forum, please don't ask here.

tedybear
Posts: 9
Joined: 2014/04/08 05:07:56

Re: How to setup BindDNS Server 9.8.2 on Centos 6.5 64Bit VP

Post by tedybear » 2014/04/21 15:51:40

avij wrote:The term you should be searching for is name-based virtual hosts. I have no idea how these are handled in webmin. This forum is not a webmin support forum, please don't ask here.
thanks moderator :) It solved now :)

Post Reply