2

I want to run a dns server to have my own nameservers : ns1.radicalteam.ir and ns2.radicalteam.ir
I have a VPS and installed Centos 6.5 on it, and radicalteam.ir and soulati.ir domains I've set soulati.ir nameservers to ns1.radicalteam.ir and ns2.radicalteam.ir I can reach radicaalteam.ir but soulati.ir is unreachable . What is the problem ??
This is my configuration in bind :
/etc/named.conf :

options {
    listen-on port 53 { 185.94.97.188;127.0.0.1; };
    allow-query     { any; };
    Allow-transfer {"none";};
    Allow-recursion {"none";};
    Recursion no;
};

zone "server.radicalteam.ir" {
type master;
file "/var/named/server.radicalteam.ir.zone";
};

zone "radicalteam.ir" {
type master;
file "/var/named/radicalteam.ir.zone";
};

/var/named/server.radicalteam.ir.zone :

$TTL 1D
@   IN  SOA ns1.radicalteam.ir. admin.radicalteam.ir. (
                                        1       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum

server.radicalteam.ir. IN  NS   ns1.radicalteam.ir.
server.radicalteam.ir. IN  NS   ns2.radicalteam.ir.
server.radicalteam.ir. IN  A    185.94.97.188
server.radicalteam.ir. IN  MX   0 server.radicalteam.ir.

/var/named/radicalteam.ir.zone :

$TTL 1D
@   IN  SOA ns1.radicalteam.ir. server.radicalteam.ir. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum

radicalteam.ir. IN  NS      ns1.radicalteam.ir.
radicalteam.ir. IN  NS      ns2.radicalteam.ir.
radicalteam.ir. IN  A       185.94.97.188
ns1     IN  A   185.94.97.188
ns2     IN  A   185.94.97.188
radicalteam.ir. IN  MX  0  radicalteam.ir.
www         IN  CNAME   radicalteam.ir.

nslookup -debug radicalteam.ir

Server:     127.0.1.1
Address:    127.0.1.1#53

------------
    QUESTIONS:
    radicalteam.ir, type = A, class = IN
    ANSWERS:
    ->  radicalteam.ir
    internet address = 185.94.97.188
    ttl = 86400
    AUTHORITY RECORDS:
    ->  radicalteam.ir
    nameserver = ns2.radicalteam.ir.
    ttl = 1290
    ->  radicalteam.ir
    nameserver = ns1.radicalteam.ir.
    ttl = 1290
    ADDITIONAL RECORDS:
    ->  ns1.radicalteam.ir
    internet address = 185.94.97.188
    ttl = 1290
    ->  ns2.radicalteam.ir
    internet address = 185.94.97.188
    ttl = 56785
------------
Non-authoritative answer:
Name:   radicalteam.ir
Address: 185.94.97.188

ping soulati.ir :

ping: unknown host soulati.ir

nslookup soulati.ir :

Server:     127.0.1.1
Address:    127.0.1.1#53

** server can't find soulati.ir: SERVFAIL

nslookup -debug soulati.ir

Server:     127.0.1.1
Address:    127.0.1.1#53

------------
    QUESTIONS:
    soulati.ir, type = A, class = IN
    ANSWERS:
    AUTHORITY RECORDS:
    ADDITIONAL RECORDS:
------------
** server can't find soulati.ir: SERVFAIL

1 Answers1

3

Both ns1.radicalteam.ir and ns2.radicalteam.ir resolve to the same address, 185.94.97.188 which is a bad idea in itself if these are supposed to be your "nameservers".

As for soulati.ir (delegated to the above "nameservers"), 185.94.97.188 responds with status REFUSED, presumably because you have no such zone configured. (If the config included in the question is the complete configuration that confirms this.)

Håkan Lindqvist
  • 33,741
  • 5
  • 65
  • 90
  • Should I configure different zone for every domain that I want to host ? – Mostafa Solati Jun 01 '16 at 07:56
  • 1
    You need to explicitly configure each domain your name server is authoritative for, but when each domain is configured identically, they can [share a single zone file](http://serverfault.com/a/669830/37681) – HBruijn Jun 01 '16 at 08:14
  • You said its bad idea to have same ip for both nameservers , you mean I have to start another vps for ns2.radicaltem.i ? or what ? I'm totally noob in this field – Mostafa Solati Jun 01 '16 at 22:01
  • http://serverfault.com/q/710108 and http://serverfault.com/q/23744 might clarify that – HBruijn Jun 01 '16 at 22:36