Set Up a Secondary Zone
Target audience
What will you learn
Procedure
1
2
Configure a Dedicated Core Server as a primary nameserver
ssh root@<IP-ADDRESS>sudo -i
apt update -y
[...]
apt install -y bind9 bind9utils
[...]vi /etc/bind/named.conf.locallogging {
category xfer-out { default_syslog; };
category xfer-in { default_syslog; };
category notify { default_syslog; };
category lame-servers { default_syslog; };
category general { default_syslog; };
category default { default_syslog; };
};
zone "primary-zone.de" IN {
type master;
file "/var/cache/bind/primary-zone.de.db";
notify explicit;
also-notify { 212.227.123.25; };
allow-update { 127.0.0.1; };
};vi /var/cache/bind/primary-zone.de.db; Zone: primary-zone.de
; Exported: Mon Aug 17 22:36:11 UTC 2023
$ORIGIN primary-zone.de.
$TTL 3600
@ 3600 IN SOA primary-zone.de. hostmaster.primary-zone.de. (
2017060104 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
600 ) ; minimum
@ 3600 IN NS ns.ui-global-dns.com.
@ 3600 IN NS ns.ui-global-dns.de.
@ 3600 IN NS ns.ui-global-dns.org.
@ 3600 IN NS ns.ui-global-dns.biz.
www 60 IN A 127.0.0.1
www 60 IN AAAA ::1named-checkconf
systemctl reload named
dig +short primary-zone.de3
Create a secondary zone in IONOS Cloud DNS
curl --location 'https://dns.de-fra.ionos.com/secondaryzones' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--data '{
"properties": {
"zoneName": "primary-zone.de",
"description": "This is a secondary zone for primary-zone.de in IONOS Cloud DNS",
"primaryIps": [
"<IP-ADDRESS>"
]
}
}'{
"id": "bdae7da0-0363-49d7-929d-92992786efe1",
"type": "secondaryzone",
"href": "/secondaryzones/bdae7da0-0363-49d7-929d-92992786efe1",
"metadata": {
"createdDate": "2023-08-06T19:36:58+00:00",
"lastModifiedDate": "2023-08-06T19:36:59+00:00",
"nameservers": [
"nscs.ui-dns.com",
"nscs.ui-dns.de",
"nscs.ui-dns.org",
"nscs.ui-dns.biz"
],
"state": "AVAILABLE"
},
"properties": {
"description": "This is a secondary zone for test-dns-public.info in IONOS Cloud DNS",
"primaryIps": [
"<IP-ADDRESS>"
],
"zoneName": "test-dns-public.info"
}
}4
Verify zone transfer
journalctl --unit named --follow
Aug 07 14:43:39 ubuntu named[2666]: client @0x7f467825b958 212.227.123.26#33308 (primary-zone.de): transfer of 'primary-zone.de/IN': AXFR started (serial 2017060104)
Aug 07 14:43:39 ubuntu named[2666]: client @0x7f467825b958 212.227.123.26#33308 (primary-zone.de): transfer of 'primary-zone.de/IN': AXFR ended: 1 messages, 8 records, 299 bytes, 0.001 secs (299000 bytes/sec) (serial 2017060104)
curl --location 'https://dns.de-fra.ionos.com/secondaryzones/bdae7da0-0363-49d7-929d-92992786efe1/axfr' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO'{
"items": [
{
"errorMessage": "",
"primaryIp": "<IP-ADDRESS>",
"status": "OK"
}
],
"type": "collection"
}dig +short www. primary-zone.de @ns.ui-global-dns.com
217.160.0.148
nsupdate
> server 127.0.0.1
> zone primary-zone.de
> update add www2.primary-zone.de. 600 IN A 203.0.113.1
> send
> quitdig +short www2.primary-zone.de @127.0.0.1
203.0.113.1Aug 07 16:00:22 ubuntu named[2666]: client @0x7f467000d0a8 127.0.0.1#34056: updating zone 'primary-zone.de/IN': adding an RR at 'www2.primary-zone.de' A 203.0.113.1
Aug 07 16:00:22 ubuntu named[2666]: zone primary-zone.de/IN: sending notifies (serial 2017060105)curl --location 'https://dns.de-fra.ionos.com/secondaryzones/bdae7da0-0363-49d7-929d-92992786efe1/records' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO'{
"id": "bdae7da0-0363-49d7-929d-92992786efe1",
"type": "collection",
"href": "/secondaryzones/bdae7da0-0363-49d7-929d-92992786efe1/records?limit=100&offset=0",
"metadata": {
"primaryIps": [
"<IP-ADDRESS>"
]
},
"items": [
{
"type": "record",
"metadata": {
"fqdn": "primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "primary-zone.de hostmaster.primary-zone.de 2017060105 28800 7200 604800 600",
"enabled": true,
"name": "",
"priority": 0,
"ttl": 3600,
"type": "SOA"
}
},
{
"type": "record",
"metadata": {
"fqdn": "primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "ns.ui-global-dns.de",
"enabled": true,
"name": "",
"priority": 0,
"ttl": 3600,
"type": "NS"
}
},
{
"type": "record",
"metadata": {
"fqdn": "primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "ns.ui-global-dns.biz",
"enabled": true,
"name": "",
"priority": 0,
"ttl": 3600,
"type": "NS"
}
},
{
"type": "record",
"metadata": {
"fqdn": "primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "ns.ui-global-dns.com",
"enabled": true,
"name": "",
"priority": 0,
"ttl": 3600,
"type": "NS"
}
},
{
"type": "record",
"metadata": {
"fqdn": "primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "ns.ui-global-dns.org",
"enabled": true,
"name": "",
"priority": 0,
"ttl": 3600,
"type": "NS"
}
},
{
"type": "record",
"metadata": {
"fqdn": "www.primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "127.0.0.1",
"enabled": true,
"name": "www",
"priority": 0,
"ttl": 3600,
"type": "A"
}
},
{
"type": "record",
"metadata": {
"fqdn": "www.primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "0:0:0:0:0:0:0:1",
"enabled": true,
"name": "www",
"priority": 0,
"ttl": 3600,
"type": "AAAA"
}
},
{
"type": "record",
"metadata": {
"fqdn": "www2.primary-zone.de",
"zoneId": "bdae7da0-0363-49d7-929d-92992786efe1",
"rootName": "primary-zone.de"
},
"properties": {
"content": "203.0.113.1",
"enabled": true,
"name": "www2",
"priority": 0,
"ttl": 3600,
"type": "A"
}
}
],
"offset": 0,
"limit": 100,
"_links": {
"self": "/secondaryzones/bdae7da0-0363-49d7-929d-92992786efe1/records?limit=100&offset=0",
"next": "/secondaryzones/bdae7da0-0363-49d7-929d-92992786efe1/records?limit=100&offset=100"
}
}dig +short www2.primary-zone.de @ns.ui-global-dns.com.Final result
Conclusion
PreviousExternalDNS for Managed KubernetesNextEnhance Email Deliverability with a Reverse DNS, SF, and DKIM Record
Last updated
Was this helpful?




