could someone explain to me what i am doing wrong, or it is just impossible to do. Just for learning, and understading how subdomain delegation works.
I have 1 domain eg.: server.com and 3 VPS servers, what i am trying to do is set custom name servers with subdomain.server.com to VPS servers like eg.: ns1.vps2.server.com ns2.vps2.server.com that users on hosting panel could manage DNS settings.
Domain server.com works on ns1.server.com ns2.server.com on 1vps vps1.server.com, some domains changed to ns1.server.com and ns2.server.com NS is changed and works, all DNS can be changed for them from vps1 hosting DNS zone.
For VPS2 and VPS3 i can't make it work.
What i have made on VPS1 where server.com domain is hosted
www.server.com. CNAME server.com.
vps1.server.com. A 1.1.1.1
vps2.server.com. A 2.2.2.2
ns1.server.com. A 1.1.1.1
ns2.server.com. A 1.1.1.2
server.com. NS ns1.server.com.
server.com. NS ns2.server.com.
ns1.vps2.server.com. A 2.2.2.2
ns2.vps2.server.com. A 2.2.2.3
vps2.server.com. NS ns1.vps2.server.com.
vps2.server.com. NS ns2.vps2.server.com.
SUCCESS: Getting information for Domain 'server.com' complete.
^ But this configuration doesn't work ^
When using nslookup on ns1.vps2.server.com
router.asus.com can't find ns1.vps2.server.com: Server failed
When using nslookup on server.com
server.com nameserver=ns1.server.com
server.com nameserver=ns2.server.com
Could someone help me with this situation? Maybe someone will find out what i am doing wrong with this.
VPS2 named.conf
// $Id: named.conf,v 1.1.1.1 2001/10/15 07:44:36 kap Exp $
// -- THE FOLLOWING LINES WERE GENERATED BY PLESK. IF YOU MODIFY THEM, THEY WILL BE OVERWRITTEN WHEN THESE SETTINGS ARE MANAGED IN PLESK UI. --
options {
allow-recursion {
any;
};
listen-on-v6 { any; };
version "none";
directory "/var";
auth-nxdomain no;
pid-file "/var/run/named/named.pid";
};
key "rndc-key" {
algorithm hmac-md5;
secret "20nyv==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
zone "." {
type hint;
file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "localhost.rev";
};
// -- END OF LINES GENERATED BY PLESK. --
// -- PLEASE ADD YOUR CUSTOM DIRECTIVES BELOW THIS LINE. --
// ...
// -- END OF YOUR CUSTOM DIRECTIVES. --
// -- ALL LINES BELOW WERE GENERATED BY PLESK. IF YOU MODIFY THEM, THEY WILL BE OVERWRITTEN WHEN THESE SETTINGS ARE MANAGED IN PLESK UI. --
zone "vps2.server.com" {
type master;
file "vps2.server.com";
allow-transfer {
common-allow-transfer;
};
};
acl common-allow-transfer {
none;
};
VPS2 named zone /var/named/...vps2.server.com
; *** This file is automatically generated by Plesk ***
$TTL 300
@ IN SOA ns1.vps2.server.com. server.server.com. (
2020080553 ; Serial
18000 ; Refresh
3600 ; Retry
604800 ; Expire
10800 ) ; Minimum
vps2.server.com. IN NS ns2.vps2.server.com.
vps2.server.com. IN NS ns1.vps2.server.com.
ns2.vps2.server.com. IN A 1.1.1.2
ipv4.vps2.server.com. IN A 1.1.1.1
mail.vps2.server.com. IN A 1.1.1.1
webmail.vps2.server.com. IN A 1.1.1.1
ns1.vps2.server.com. IN A 1.1.1.1
www.vps2.server.com. IN CNAME vps2.server.com.
ftp.vps2.server.com. IN CNAME vps2.server.com.
vps2.server.com. IN MX 10 mail.vps2.server.com.
vps2.server.com. IN TXT "v=spf1 +a +mx +a:vps2.server.com -all"
_dmarc.vps2.server.com. IN TXT "v=DMARC1; p=none"
_imaps._tcp.vps2.server.com. IN SRV 0 0 993 vps2.server.com.
_pop3s._tcp.vps2.server.com. IN SRV 0 0 995 vps2.server.com.
_smtps._tcp.vps2.server.com. IN SRV 0 0 465 vps2.server.com.
VPS1 named zone /var/named/...vps2.server.com
; *** This file is automatically generated by Plesk ***
$TTL 300
@ IN SOA ns1.vps2.server.com. server.server.com. (
2020080576 ; Serial
60 ; Refresh
300 ; Retry
604800 ; Expire
1 ) ; Minimum
vps2.server.com. IN NS ns2.vps2.server.com.
vps2.server.com. IN NS ns1.vps2.server.com.
ns1.vps2.server.com. IN A 1.1.1.1
ns2.vps2.server.com. IN A 1.1.1.2
vps2.server.com. IN A 1.1.1.1
www.vps2.server.com. IN CNAME vps2.server.com.
vps2.server.com. IN MX 10 vps2.server.com.
From VPS2 $dig vps2.server.com
root@vps2:~# dig vps2.server.com
; <<>> DiG 9.10.3-P4-Debian <<>> vps2.server.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29912
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;vps2.server.com. IN A
;; ANSWER SECTION:
vps2.server.com. 299 IN A 1.1.1.1
;; Query time: 28 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Aug 06 07:57:31 EEST 2020
;; MSG SIZE rcvd: 57
From VPS1 $dig vps2.server.com
root@vps2:~# dig vps2.server.com
; <<>> DiG 9.10.3-P4-Debian <<>> vps2.server.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45514
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;vps2.server.com. IN A
;; ANSWER SECTION:
vps2.server.com. 68 IN A 1.1.1.1
;; AUTHORITY SECTION:
vps2.server.com. 68 IN NS ns1.vps2.server.com.
vps2.server.com. 68 IN NS ns2.vps2.server.com.
;; ADDITIONAL SECTION:
ns1.vps2.server.com. 68 IN A 1.1.1.1
ns2.vps2.server.com. 68 IN A 1.1.1.2
;; Query time: 0 msec
;; SERVER: 80.208.229.143#53(80.208.229.143)
;; WHEN: Thu Aug 06 07:58:59 EEST 2020
;; MSG SIZE rcvd: 125