How To Configure Dynamic DNS Server On A Cisco Router
Hosting your own webserver or email server would normaly require a static IP address from your ISP. This ensures that your services are always reachable using the same IP address or domain name.
If you had a domain name, e.g firewall.cx, you would then map your static IP address to your domain (via DNS) so when you hit your domain name, you would be directed to your statically assigned IP address and access the resources you need.
While this is the recommended setup for most companies doing serious business, it doesn't really apply to home users or small branch offices because of the increased cost for static IP addresses.
Luckily, a few years back, a couple of new DNS providers came up with Dynamic DNS or DDNS. DDNS providers essentially allow you to register and create a Fully Qualified Domain Name (FQDN) without cost and, by using their clients (usually programs installed on a PC in your local network), you can instanteously update your FQDN every time your ISP changes your IP address. This eliminates the need for a static IP address, since your DDNS provider will automatically update its DNS records with your dynamic IP address every time it changes.
From Cisco IOS version 12.4 onwards, Cisco routers have built-in support for a variety of DDNS providers, making it much easier and more reliable as you no longer require a PC in your network that will run the DDNS provider's client.
This article aims to teach you how you can configure your Cisco router so it can support DDNS with a variety of DDNS providers.
Example Scenario
Consider the following network diagram. It shows the simple logic of how DDNS works:
Firstly we need to configure our Cisco router to register and send its periodical updates to the DDNS provider. Once received, the DDNS provider updates the relevant DNS records, in our example, firewallcx.no-ip.info.
When an Internet host queries the DDNS provider for the domain firewallcx.no-ip.info, it will then point the host towards the public IP addresses currently assigned to the router, that is, 195.162.29.1. As the ISP changes the IP address it assigned to the Cisco router, the router in turn will also update its DDNS provider. This way, the domain firewallcx.no-ip.info is always updated no matter how many times its IP address changes.
So, without further delay, here's how you can configure your Cisco router to register with the following DDNS providers:
1) No-ip.com
2) Dyndns.com
Case No.1: No-ip.com
First step is to enable the DNS service and configure an IP name server (public DNS server) so it can successfully resolve Internet domain names. For our example, we are using Public DNS servers.
R1# configure terminal
R1(config)# ip dns server
R1(config)# ip name-server 4.2.2.6
R1(config)# ip name-server 4.2.2.5
Next, we need to enable the DDNS update service and give it a name (no-ip), and then select the update method to be used, for this example, it's HTTP:
R1(config)# ip ddns update method no-ip
R1(DDNS-update-method)# HTTP
Now we add the authentication details. The router will use this information to authenticate to the DDNS provider so it can then update the necessary hostname. We should note that each DDNS provider uses its own authentication method & parameters. In No-ip.com's case, it makes use of a login name & password, where the login name is your registered email address.
The command will look something like this:
add http://email:password@dynupdate.no-ip.com/nic/update?hostname=
R1(DDNS-HTTP)# add http://user%40gmail.com:password%40dynupdate.no-ip.com/nic/update%3Fhostname=
Note: The above command is one full line
The
The above command sets the update interval to 0 Days, 0 Hours, 5 Minutes and 0 Seconds.
This completes the setup and your router should start sending its updates to the DDNS provider.
Here are the results of our debug:
Case No.2: Dyndns.com
The following cli code is the actual configuration required up till the authentication method:
The HTTP authentication string required for Dyndns.com will look something like this:
add http://username:password@members.dyndns.org/nic/update?system=dyndns&hostname=
R1(DDNS-HTTP)# add http://firewall:pass%40members.dyndns.org
/nic/update%3Fsystem=dyndns&hostname=
Note: The above command is one full line
Again, the
The above command sets the update interval to 1 Days, 0 Hours, 0 Minutes and 0 Seconds.
This completes the setup and your router should start sending its updates to the DDNS provider.
Here are the results of our debug:
0 Response to "How To Configure Dynamic DNS Server On A Cisco Router"
Post a Comment