filmov
tv
How to set up DHCP Dynamic DNS on Ubuntu
Показать описание
In this video, we show you how to configure Dynamic DNS (DDNS) in Linux using Ubuntu 20.04 LTS with Bind9 and ISC DHCP
We'll create a key for our DHCP server to authenticate with, configure the DNS server to accept DDNS updates from the DHCP server and the DHCP server to send DDNS updates to the DNS server
Useful links:
=============================
SUPPORT THE CHANNEL
Donate through Paypal:
Donate through Buy Me A Coffee:
Become a monthly contributor on Patreon:
Become a monthly contributor on YouTube:
==============================
Configuration example:
1) Create Key File
Create a key file to keep the password separate from the main file
On the DNS server, switch to the bind folder
cd /etc/bind
Then create our key by running the following command
Copy the key example and modify to suit, e.g.
algorithm hmac-sha256;
secret "/mAXOLTQUp8V9XzYnw88dkOkiDXBU6SNv/jEL3IgKVE=";
};
I used the FQDN of the DHCP server to name this key, but it's up to yourself as to what reference you want to use
Create a key file, paste the contents in and save this file
Change the ownership if necessary
2) Move Zone Files
The bind server needs to create new files and modify the zone files when updates are received. For this reason, any zones requiring dynamic updates need to be moved to /var/lib/bind/
sudo mv db.172.16 /var/lib/bind/
3) Update DNS Configuration
The DNS server configuration needs to be updated as the zone files have been moved
It needs to know where to find the key, where to find the zone files we've moved and be configured to allow updates from the DHCP server
First, make a backup copy of the file and then apply our changes
type master;
update-policy {
};
};
type master;
file "/var/lib/bind/db.172.16";
update-policy {
};
};
The update policies above allows a computer with the key to change host records of any name in the forward lookup zone, but only if these are type A or DHCID records
This is possible because we used the wildcard option
It can also update the reverse lookup zone, but only if these are PTR records
Check the DNS server configuration syntax
sudo named-checkconf
Then restart and check the bind9 status
sudo systemctl restart bind9
sudo systemctl status bind9
4) Update DHCP Configuration
The DHCP server needs to know the key so we'll create a new file and copy the key we created on the DNS server
cd /etc/dhcp
mkdir ddns-keys
It also needs updating to support DDNS, to tell it where to find the key, to enable DDNS using the standard style and also which zones to update, what the primary DNS server is and what key to use
First, make a backup copy of the file and then apply our changes
ddns-updates on;
ddns-update-style standard;
primary 172.16.17.10;
}
primary 172.16.17.10;
}
After saving the changes, restart and check the DHCP server status
sudo systemctl restart isc-dhcp-server
sudo systemctl status isc-dhcp-server
DNS should now be updated when IP addresses are leased or released
5) Maintenance
Pause DDNS before making static changes
sudo rndc freeze
Apply your changes, increment the serial number then resume
sudo rndc thaw
6) Troubleshooting
If host entries aren't being updated monitor syslog on both servers
sudo tail -f /var/log/syslog
Credits:
LoveLife | Instrumental Prod. Blue Mango | EQMUSEQ.COM by Don Da Vinci
00:00 Intro
00:54 Assumptions
01:12 Create Key File
04:40 Move Zone Files
08:31 Configure DNS Server
15:12 Configure DHCP Server
21:05 Testing
33:28 Zone Maintenance
39:10 Summary
ddns setup,dynamic dns set up,dynamic dns explained,linux dynamic dns server,dynamic dns linux,ubuntu dynamic dns,ubuntu dynamic dns server,dhcp ddbns,dhcp ddbns-update-style,dhcp dynamic dns,dhcp dynamic dns updates,dhcp dynamic dns udpate,ddns
We'll create a key for our DHCP server to authenticate with, configure the DNS server to accept DDNS updates from the DHCP server and the DHCP server to send DDNS updates to the DNS server
Useful links:
=============================
SUPPORT THE CHANNEL
Donate through Paypal:
Donate through Buy Me A Coffee:
Become a monthly contributor on Patreon:
Become a monthly contributor on YouTube:
==============================
Configuration example:
1) Create Key File
Create a key file to keep the password separate from the main file
On the DNS server, switch to the bind folder
cd /etc/bind
Then create our key by running the following command
Copy the key example and modify to suit, e.g.
algorithm hmac-sha256;
secret "/mAXOLTQUp8V9XzYnw88dkOkiDXBU6SNv/jEL3IgKVE=";
};
I used the FQDN of the DHCP server to name this key, but it's up to yourself as to what reference you want to use
Create a key file, paste the contents in and save this file
Change the ownership if necessary
2) Move Zone Files
The bind server needs to create new files and modify the zone files when updates are received. For this reason, any zones requiring dynamic updates need to be moved to /var/lib/bind/
sudo mv db.172.16 /var/lib/bind/
3) Update DNS Configuration
The DNS server configuration needs to be updated as the zone files have been moved
It needs to know where to find the key, where to find the zone files we've moved and be configured to allow updates from the DHCP server
First, make a backup copy of the file and then apply our changes
type master;
update-policy {
};
};
type master;
file "/var/lib/bind/db.172.16";
update-policy {
};
};
The update policies above allows a computer with the key to change host records of any name in the forward lookup zone, but only if these are type A or DHCID records
This is possible because we used the wildcard option
It can also update the reverse lookup zone, but only if these are PTR records
Check the DNS server configuration syntax
sudo named-checkconf
Then restart and check the bind9 status
sudo systemctl restart bind9
sudo systemctl status bind9
4) Update DHCP Configuration
The DHCP server needs to know the key so we'll create a new file and copy the key we created on the DNS server
cd /etc/dhcp
mkdir ddns-keys
It also needs updating to support DDNS, to tell it where to find the key, to enable DDNS using the standard style and also which zones to update, what the primary DNS server is and what key to use
First, make a backup copy of the file and then apply our changes
ddns-updates on;
ddns-update-style standard;
primary 172.16.17.10;
}
primary 172.16.17.10;
}
After saving the changes, restart and check the DHCP server status
sudo systemctl restart isc-dhcp-server
sudo systemctl status isc-dhcp-server
DNS should now be updated when IP addresses are leased or released
5) Maintenance
Pause DDNS before making static changes
sudo rndc freeze
Apply your changes, increment the serial number then resume
sudo rndc thaw
6) Troubleshooting
If host entries aren't being updated monitor syslog on both servers
sudo tail -f /var/log/syslog
Credits:
LoveLife | Instrumental Prod. Blue Mango | EQMUSEQ.COM by Don Da Vinci
00:00 Intro
00:54 Assumptions
01:12 Create Key File
04:40 Move Zone Files
08:31 Configure DNS Server
15:12 Configure DHCP Server
21:05 Testing
33:28 Zone Maintenance
39:10 Summary
ddns setup,dynamic dns set up,dynamic dns explained,linux dynamic dns server,dynamic dns linux,ubuntu dynamic dns,ubuntu dynamic dns server,dhcp ddbns,dhcp ddbns-update-style,dhcp dynamic dns,dhcp dynamic dns updates,dhcp dynamic dns udpate,ddns
Комментарии