Skip to content

Commit 071decc

Browse files
StuartJMackintoshimjuniperjaapmarcus
authored
Update dns.md - mainly Master -> Slave config (hestiacp#3867)
* Update dns.md - mainly Master -> Slave config Docs updated when deploying slave configuration. Master <-> Master could do with re-validating as it may be affected by the changes. I also made general changes which I believe makes the document more readable. * Update docs/docs/server-administration/dns.md Co-authored-by: Jakob Bouchard <jakob@jakobbouchard.dev> * Update docs/docs/server-administration/dns.md Co-authored-by: Jakob Bouchard <jakob@jakobbouchard.dev> * Update docs/docs/server-administration/dns.md Co-authored-by: Jakob Bouchard <jakob@jakobbouchard.dev> * Update docs/docs/server-administration/dns.md Co-authored-by: Jakob Bouchard <jakob@jakobbouchard.dev> * Update dns.md - addressed linting & pritty issues * Update dns.md - more formatting tweaks * Update dns.md removed trailing newline at end of page * Update dns.md - text tweaks, clarified M/S user name * Fix format --------- Co-authored-by: Jakob Bouchard <jakob@jakobbouchard.dev> Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent c28cc3c commit 071decc

File tree

1 file changed

+60
-33
lines changed
  • docs/docs/server-administration

1 file changed

+60
-33
lines changed

docs/docs/server-administration/dns.md

Lines changed: 60 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,55 @@
44
With the release of version 1.7.0, we have implemented support for DNSSEC. DNSSEC requires a Master -> Slave setup. IF the existing implementation is a Master <-> Master setup, it is not supported. DNSSEC also requires at least Ubuntu 22.04 or Debian 11!
55
:::
66

7-
## Host your DNS on Hestia
7+
## Host DNS for your domain on Hestia
88

9-
[Create a DNS Zone](../user-guide/dns.md#adding-a-dns-zone) with the **child-ns** template, then login to your domain registrar’s panel and change the name servers of the domain. Depending your registrar panel, you could be able to create glue records. You may need to wait for up to 24 hours before the name servers become active.
9+
Pre-requisites
1010

11-
## DNS Cluster setup
11+
These steps require that you configure the DNS servers of your domain to use your Hestia servers.
12+
13+
- Note that most domain providers require two or more DNS servers to be configured.
14+
- The name servers will most likely be required to be registered as 'Glue records'
15+
- You may need to wait for up to 24 hours before the name servers become available
16+
17+
Preparing the domain and DNS
18+
19+
1. On your Hestia master, [create a DNS Zone](../user-guide/dns.md#adding-a-dns-zone) with the **child-ns** template
20+
2. On your domain registrar panel, set the name servers of the domain to the Hestia servers
21+
22+
If you are looking at options to minimise DNS-related downtime or for a way to automatically synchronise DNS zones across all your servers, you might consider setting up a DNS cluster.
23+
24+
If DNSSEC matters to you, then you must use Master -> Slave. However if you would like to add zones to either server and have them replicate to the other, then configure as Master <-> Master.
1225

1326
::: tip
14-
Create for each server a unique user and assing them the "Sync DNS User" or "dns-cluster" role!
27+
If you have just set up your slave, check that the host name resolves and that you have a valid SSL certificate
1528
:::
1629

17-
If you are looking at options to minimise DNS-related downtime or for a way to manage DNS across all your servers, you might consider setting up a DNS cluster.
30+
## DNS Cluster setup
1831

19-
1. Whitelist your master server IP in **Configure Server** -> **Security** -> **Allowed IP addresses for API**, otherwise you will get an error when adding the slave server to the cluster.
20-
2. Enable API access for admins (or all users).
21-
3. Create an API key under the **admin** user with at least the **sync-dns-cluster** permission.
32+
A Master server is where DNS zones are created, and a Slave server recieves the zone via the API. Hestia can be configured as Master <-> Master or Master -> Slave. With a Master <-> Master configuration, each Master is also a Slave, so it could be considered as Master/Slave <-> Master/Slave.
33+
34+
On each Slave server, a unique user is required who will be assigned the zones, and must be assigned the "Sync DNS User" or "dns-cluster" role.
2235

2336
::: info
24-
With the release of 1.6.0, we have implemented a new API authentication system. We strongly suggest using this method instead of the old system, as it is more secure due to the length of the access key and secret key!
37+
With the release of 1.6.0, we have implemented a new API Access Key authentication system. We strongly suggest using this method instead of the previous username/password system, as it is more secure due to the length of the access key and secret key!
2538

2639
If you still want to use the legacy API to authenticate with **admin** username and the password make sure **Enable legacy API** access is set to **yes**.
2740
:::
2841

29-
### DNS Cluster with the Hestia API (Master <-> Master) "Default setup!"
42+
### Master <-> Master DNS cluster (Default setup) with the Hestia API
3043

3144
::: warning
3245
This method does not support DNSSEC!
3346
:::
3447

35-
1. Create a new user on the Hestia server that will act as a “Slave”. Make sure it uses the username of "dns-cluster" or has the role `dns-cluster`
48+
1. Create a new user on each Hestia server that will act as a “Slave”. Make sure it uses the username of "dns-cluster" or has the role `dns-cluster`
3649
2. Run the following command to enable the DNS server.
3750

3851
```bash
3952
v-add-remote-dns-host slave.yourhost.com 8083 'accesskey:secretkey' '' 'api' 'username'
4053
```
4154

42-
Or if you still want to use admin and password authentication
55+
Or if you still want to use admin and password authentication (not recommended)
4356

4457
```bash
4558
v-add-remote-dns-host slave.yourhost.com 8083 'admin' 'strongpassword' 'api' 'username'
@@ -49,46 +62,58 @@ This way you can set up Master -> Slave or Master <-> Master <-> Master cluster.
4962

5063
There is no limitation on how to chain DNS servers.
5164

52-
### DNS Cluster with the Hestia API (Master -> Slave)
65+
### Master -> Slave DNS cluster with the Hestia API
5366

54-
1. Create a new user on the Hestia server that will act as a “Slave”. Make sure it uses the username of "dns-user" or has the role `dns-cluster`
55-
2. In `/usr/local/hestia/conf/hestia.conf`, change `DNS_CLUSTER_SYSTEM='hestia'` to `DNS_CLUSTER_SYSTEM='hestia-zone'`.
56-
3. On the master server, open `/etc/bind/named.conf.options`, do the following changes, then restart bind9 with `systemctl restart bind9`.
67+
Preparing your **Slave** server(s):
68+
69+
1. Whitelist your master server IP in **Configure Server** -> **Security** -> **Allowed IP addresses for API**
70+
2. Enable API access for admins (or all users).
71+
3. Create an API key under the **admin** user with at least the **sync-dns-cluster** permission.
72+
4. Create a new DNS sync user as follows:
73+
- Has email address (something generic)
74+
- Has the role `dns-cluster`
75+
- You may want to set 'Do not allow user to log in to Control Panel' if they are not a regular user
76+
5. Edit `/usr/local/hestia/conf/hestia.conf`, change `DNS_CLUSTER_SYSTEM='hestia'` to `DNS_CLUSTER_SYSTEM='hestia-zone'`.
77+
6. Edit `/etc/bind/named.conf.options`, do the following changes, then restart bind9 with `systemctl restart bind9`:
5778

5879
```bash
5980
# Change this line
60-
allow-transfer { "none"; };
81+
allow-recursion { 127.0.0.1; ::1; };
6182
# To this
62-
allow-transfer { your.slave.ip.address; };
63-
# Or this, if adding multiple slaves
64-
allow-transfer { first.slave.ip.address; second.slave.ip.address; };
65-
# Add this line, if adding multiple slaves
66-
also-notify { second.slave.ip.address; };
83+
allow-recursion { 127.0.0.1; ::1; your.master.ip.address; };
84+
# Add this line
85+
allow-notify{ your.master.ip.address; };
6786
```
6887

69-
4. On the slave server, open `/etc/bind/named.conf.options`, do the following changes, then restart bind9 with `systemctl restart bind9`:
88+
Preparing your **Master** server:
89+
90+
1. On the **Master** server, open `/etc/bind/named.conf.options`, do the following changes, then restart bind9 with `systemctl restart bind9`.
7091

7192
```bash
7293
# Change this line
73-
allow-recursion { 127.0.0.1; ::1; };
94+
allow-transfer { "none"; };
7495
# To this
75-
allow-recursion { 127.0.0.1; ::1; your.master.ip.address; };
76-
# Add this line
77-
allow-notify{ your.master.ip.address; };
96+
allow-transfer { your.slave.ip.address; };
97+
# Or this, if adding multiple slaves
98+
allow-transfer { first.slave.ip.address; second.slave.ip.address; };
99+
# Add this line, if adding multiple slaves
100+
also-notify { second.slave.ip.address; };
78101
```
79102

80-
5. Run the following command to enable the DNS server:
103+
2. Run the following command to enable each Slave DNS server, and wait a short while for it to complete zone transfers:
81104

82105
```bash
83-
v-add-remote-dns-host slave.yourhost.com 8083 'accesskey:secretkey' '' 'api' 'user-name'
106+
v-add-remote-dns-host <your slave host name> <port number> '<accesskey>:<secretkey>' '' 'api' '<your chosen slave user name>'
84107
```
85108

86-
If you still want to use admin and password authentication:
109+
If you still want to use admin and password authentication (not recommended):
87110

88111
```bash
89112
v-add-remote-dns-host slave.yourhost.com 8083 'admin' 'strongpassword' 'api' 'user-name'
90113
```
91114

115+
3. Check it worked by listing the DNS zones on the **Slave** for the dns-user with the CLI command `v-list-dns-domains dns-user` or by connecting to the web iterface as dns-user and reviewing the DNS zones.
116+
92117
### Converting an existing DNS cluster to Master -> Slave
93118

94119
1. In `/usr/local/hestia/conf/hestia.conf`, change `DNS_CLUSTER_SYSTEM='hestia'` to `DNS_CLUSTER_SYSTEM='hestia-zone'`.
@@ -134,7 +159,9 @@ Depending on your registrar, you will either be able to create a new record base
134159
Removing or disabling the private key in Hestia will make the domain inaccessble.
135160
:::
136161

137-
## Can I separate DNS accounts by users
162+
## FAQ & troubleshooting
163+
164+
### Can I separate DNS accounts by users
138165

139166
Yes, you can just supply the user variable at the end of the command.
140167

@@ -154,7 +181,7 @@ With the new API system, you can also replace `api_key` with `access_key:secret_
154181
By default the user `dns-cluster` or user with the role `dns-cluster` are exempted from syncing to other DNS servers!
155182
:::
156183

157-
## I am not able to add a server as DNS host
184+
### I am not able to add a server as DNS host
158185

159186
When trying to add a DNS server for a cluster I get the following error:
160187

@@ -163,4 +190,4 @@ When trying to add a DNS server for a cluster I get the following error:
163190
Error: api connection to slave.domain.tld failed
164191
```
165192

166-
By default, API access has been disabled for non-local IP addresses. Please add your IP address to the **Allowed IP addresses for API** field in the server settings.
193+
By default, API access is disabled for non-local IP addresses. On your **Slave**, add the IP address of your **Master** to the **Allowed IP addresses for API** field in Server settings -> Configure -> Security -> System -> Allowed IP addresses for API and press Save.

0 commit comments

Comments
 (0)