Dynamic DNS (DDNS) is an extension to the DNS protocol that enables computers and servers to always have the same domain name even if their public IP address keeps changing often.
Problem with basic DNS
The standard DNS protocol enables us to find out the public IP address of a computer, given its domain name. But DNS assumes a static IP address for end computers and would not work properly if the IP addresses of end computers keep changing frequently.
Due to the additional cost associated with obtaining a static IP address and also due to the limit in the number of available static IP addresses, a significant percentage of computers connected to the public internet do not have static IP addresses.
While enterprise servers and campus servers would normally have static public IP addresses, millions of small office and home computers, still get dynamic public IP addresses from their ISP, typically through the standard DHCP protocol. This is primarily due to two reasons: a) small enterprises and home users do not want to spend additional amounts for obtaining static IP addresses and b) Local ISPs would like to optimally make use of their allotted public IP address pool, by dynamically allotting IP addresses from their pool to their end clients only on a need basis.
The net result is that the public IP addresses allotted to small office and home computers may keep changing dynamically, either when they reboot or when their IP address comes up for renewal through DHCP.
But many small office and home users would like to run their own servers like web server, file server etc. and make it available to other users in the internet. More importantly, they would require that the domain names associated with these servers remain constant, irrespective of the current public IP address associated with these servers.
For example, an end user Alice, might want his media server to always have the domain name “Aliceemail@example.com”, even though his media server may have different public IP addresses like 188.8.131.52, 184.108.40.206, 220.127.116.11 etc., each time the media server is booted up. It is here that the DDNS protocol comes in handy.
All the end user Alice has to do, is to subscribe to the DDNS service offered by his ISP. The DDNS service would make sure that the ISP’s DNS server is updated with the latest public IP address allotted to Alice’s media server.
How DDNS works
DDNS is typically implemented as a small piece of software in the end computer. It would have a DDNS client software and optionally a DDNS server software.
DDNS client software typically takes the role of detecting IP address changes on the end computer side and immediately sending DNS update messages to the corresponding authoritative DNS server, so that the DNS server always has the current IP address of an end computer and its associated domain name mapping.
DDNS client software may be implemented as part of the OS itself (like Windows, Linux etc.) or it can be installed as part of an add-on software provided by the ISP. If the DDNS client sends standard DNS update messages to the DNS server, for updating the IP address of a domain name, then a separate DDNS server may not be needed at the ISP’s DNS server end. A separate DDNS server component would be needed only in cases where vendor specific proprietary update messages are sent by the DDNS client to the ISP’s DNS service.
Also the mechanism of detecting changes in the IP addresses of end hosts may vary between different implementations. While some implementations may modify the DHCP stack to detect IP address changes of end computers, other implementations may just snoop on DHCP protocol messages.
In summary, DDNS is a simple extension to the DNS protocol, that allows computers and servers to always be reachable through a common domain name even though their public IP address may not be static.