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
  • are you sure it is a DNS problem and not something wrong with the webserver? Try ping or nslookup with your hostnames and see if that works first. – chicks Jun 1 '16 at 2:44
  • "soulati.ir is unreachable": can you elaborate on this? what test, exactly, have you performed and which output did it generated? – Damiano Verzulli Jun 1 '16 at 5:12
  • @DamianoVerzulli Debug info added to the post – Mostafa Solati Jun 1 '16 at 6:10
  • @chicks Debug info added to the post – Mostafa Solati Jun 1 '16 at 6:10
  • "soulati.ir is unreachable": you're unable to " resolve" at DNS level. Please provide details about related DNS configuration, as your question is lacking any kind of detail about "soulati.ir" domain/zone configuration. – Damiano Verzulli Jun 1 '16 at 6:22
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.)

  • Should I configure different zone for every domain that I want to host ? – Mostafa Solati Jun 1 '16 at 7: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 – HBruijn Jun 1 '16 at 8: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 1 '16 at 22:01
  • serverfault.com/q/710108 and serverfault.com/q/23744 might clarify that – HBruijn Jun 1 '16 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.