You are on page 1of 4

   

Modules
How to configure Dynamic DNS Server on a Cisco Router

·  Home  Hosting your own webserver or email server would normaly require a static IP 
·  Alternative Menu   address from your ISP. This ensures that your services are always reachable using 
·  Amazon   the same IP address or domain name. If you had a domain name, e.g firewall.cx, you 
·  Cisco Decrypter   would then map your static IP address to your domain (via DNS) so 
·  Cisco Lab Partners  
·  Feedback   when you hit your domain name, you would be directed to your statically assigned IP address 
·  Forums   and access the resources you need.
·  Max Arcade  
·  Private Messages   While this is the recommended setup for most companies doing serious business, it doesn't 
·  Recommend Us   really apply to home users or small branch offices because of the increased cost for static IP 
·  Statistics   addresses. 
·  Stories Archive  
·  Submit News  
Luckily, a few years back, a couple of new DNS providers came up with Dynamic DNS or 
·  Surveys  
DDNS. DDNS providers essentially allow you to register and create a Fully Qualified Domain 
·  Topics  
Name (FQDN) without cost and, by using their clients (usually programs installed on a PC in 
·  Web Links  
your local network), you can instanteously update your FQDN every time your ISP changes 
·  Your Account  
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.

Cisco Knowledgebase 
From Cisco IOS version 12.4 onwards, Cisco routers have built­in support for a variety of 
Articles 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. 
­ Configuring DHCP  
­ Configuring DNAT  
This article aims to teach you how you can configure your Cisco router so it can support 
­ Password Recovery  
DDNS with a variety of DDNS providers. 
­ Configuring Dynamic 

DNS 
­ Configuring NTP  
  
­ More Cisco articles  

Example Scenario
 
Consider the following network diagram. It shows the simple logic of how DDNS works:
Site Info
 
 Welcome,  Anonymous  

Nickname
Password
Security Code: 

  
Type Security Code: 
 
Login   
· Register  
· Lost Password

 Membership: 
 Latest:    vishnoz  
 New Today:  7 
 New Yesterday:  7 
Firstly we need to configure our Cisco router to register and send its periodical updates to the
 Waiting:  3 
DDNS provider. Once received, the DDNS provider updates the relevant DNS records, in our 
 Overall:  23698 
example, firewallcx.no­ip.info.  

 People Online:  
When an Internet host queries the DDNS provider for the domain firewallcx.no­ip.info, it will 
 Visitors:  90 
then point the host towards the public IP addresses currently assigned to the router, that is, 
 Members:  2 
195.162.29.1. As the ISP changes the IP address it assigned to the Cisco router, the router in
 Hidden:  0 
turn will also update its DDNS provider. This way, the domain firewallcx.no­ip.info is always 
 Total:  92 
updated no matter how many times its IP address changes.
 Online Now: 
01:      chinnu95   So, without further delay, here's how you can configure your Cisco router to register with the 
02:      pedenski   following DDNS providers:

We received   1) No­ip.com 
64939157  
page views since  
15th September 2003   2) Dyndns.com

Hits New Today:  21591   Case No.1: No­ip.com 


Hits New Yesterday: 
44896  
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. 

Top Downloads
R1# configure terminal
R1(config)# ip dns server
­ Server Monitor  
R1(config)# ip name­server 4.2.2.6 
­ Network Scanner  
R1(config)# ip name­server 4.2.2.5 
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. 

Top Downloads
R1# configure terminal
R1(config)# ip dns server
­ Server Monitor  
R1(config)# ip name­server 4.2.2.6 
­ Network Scanner  
R1(config)# ip name­server 4.2.2.5 
 

 
Gold Lab Partners

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=<h>&myip=<a> 

As we said, the login name is your registered email address. This means that the full syntax 
above will contain two '@' characters, which can create a problem with the URL sent to the 
DDNS provider. Also, the '?' character cannot be inserted straight into the command as the 
router will think you're asking for help and give you errors!

In order to overcome all possible problems, we've replaced these characters with their 
equivalent HTML codes, so the @ becomes %40, and the ? becomes %3F:

R1(DDNS­HTTP)# add http://user%40gmail.com:password%
40dynupdate.no­ip.com/nic/update%3Fhostname=<h>&myip=<a> 

Note: The above command is one full line 

The <h> will be substituted with the FQDN that needs to be updated (firewallcx.no­ip.info) 
which we will configure next, and the <a> will be substituted with the IP address of the 
interface we have enabled for the DDNS updates.

In the next step, we set the update interval, to ensure the FQDN is updated as frequently 
possible, but without causing problems to the DDNS provider: 

R1(DDNS­HTTP)# interval maximum 0 0 5 0 

The above command sets the update interval to 0 Days, 0 Hours, 5 Minutes and 0 Seconds.

All that's left now is to set the FQDN we'll be updating and enable the DDNS service on our 
public interface (usually your Dialer 0 or public Ethernet interface):

R1(DDNS­update­method)# interface dialer0 
R1(config­if)# ip ddns update hostname firewallcx.no­ip.info 
R1(config­if)# ip ddns update no­ip 

This completes the setup and your router should start sending its updates to the DDNS 
provider. 

If you see that your FQDN hasn't been updated after 5­10 minutes, then you can also use the
following debug commands (hit CTRL­Z first) to get an idea of what's happening in the 
background:

R1# debug ip ddns update 

Here are the results of our debug: 

Jan 23 14:26:51.859: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to down  
Jan 23 12:26:51.859: DYNUPD: SWIF goingdown 'Virtual­Access3' 
Jan 23 14:27:05.091: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to up 
Jan 23 12:27:05.091: DYNUPD: SWIF comingup 'Virtual­Access3' 
Jan 23 12:27:07.883: DYNDNSUPD: Adding DNS mapping for firewallcx.no­
ip.info<=> 195.162.29.1 
Jan 23 12:27:07.883: HTTPDNS: Update add called for firewallcx.no­ip.info<=> 
Jan 23 14:26:51.859: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to down  
Jan 23 12:26:51.859: DYNUPD: SWIF goingdown 'Virtual­Access3' 
Jan 23 14:27:05.091: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to up 
Jan 23 12:27:05.091: DYNUPD: SWIF comingup 'Virtual­Access3' 
Jan 23 12:27:07.883: DYNDNSUPD: Adding DNS mapping for firewallcx.no­
ip.info<=> 195.162.29.1 
Jan 23 12:27:07.883: HTTPDNS: Update add called for firewallcx.no­ip.info<=> 
195.162.29.1

Case No.2: Dyndns.com

Dyndns.com requires a similar configuration as our previous DDNS provider, however, the HTTP
authentication string is slightly different, and you'll need to adjust your update interval to 
once a day rather than every 5 minutes. The interval adjustment is very important as 
Dyndns.com is unfortunately less forgiving than No­ip.com and will lock your account if 
multiple updates occur without your IP address having been changed!

The following cli code is the actual configuration required up till the authentication method: 

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 
R1(config)# ip ddns update method dyndns 
R1(DDNS­update­method)# HTTP 

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=
<h>&myip=<a>

Notice that the authentication string is slightly different. As with our previous example, to 
ensure we overcome all possible problems, we'll replace the '@' and '?' characters with the 
HTML equivalent codes, so the @ becomes %40, and the ? becomes %3F. Here's the full 
picture: 

R1(DDNS­HTTP)# add http://firewall:pass%40members.dyndns.org 
/nic/update%3Fsystem=dyndns&hostname=<h>&myip=<a>

Note: The above command is one full line 

Again, the <h> will be substituted with the FQDN that needs to be updated 
(firewallcx.dyndns.info) which we will configure next, and the <a> will be substituted with the 
IP address of the interface we have enabled for the DDNS updates.

In the next step, we set the update interval to ensure the FQDN is updated as frequently as 
possible, but without causing problems to the DDNS provider, for Dyndns.com, that's once a 
day: 

R1(DDNS­HTTP)# interval maximum 1 0 0 0 

The above command sets the update interval to 1 Days, 0 Hours, 0 Minutes and 0 Seconds.

All that's left now is to set the FQDN we'll be updating and enable the DDNS service on our 
public interface (usually your Dialer 0 or public Ethernet interface):

R1(DDNS­update­method)# interface dialer0 
R1(config­if)# ip ddns update hostname firewall.dyndns.info 
R1(config­if)# ip ddns update dyndns  

This completes the setup and your router should start sending its updates to the DDNS 
provider. 

If you see that the your FQDN hasn't been updated after 5­10 minutes, then you can also use
the following debug commands (hit CTRL­Z first) to get an idea on what's happening in the 
background:

R1# debug ip ddns update 

Here are the results of our debug: 

Jan 24 12:26:51.859: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to down  
Jan 24 12:26:51.859: DYNUPD: SWIF goingdown 'Virtual­Access3' 
Jan 24 12:27:05.091: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to up 
Here are the results of our debug: 

Jan 24 12:26:51.859: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to down  
Jan 24 12:26:51.859: DYNUPD: SWIF goingdown 'Virtual­Access3' 
Jan 24 12:27:05.091: %LINEPROTO­5­UPDOWN: Line protocol on Interface 
Virtual­Access3, changed state to up 
Jan 24 12:27:05.091: DYNUPD: SWIF comingup 'Virtual­Access3' 
Jan 24 12:27:07.883: DYNDNSUPD: Adding DNS mapping for 
firewall.dyndns.info<=> 195.162.49.4
Jan 24 12:27:07.883: HTTPDNS: Update add called for firewall.dyndns.info<=> 
195.162.49.4

Article Summary

In this article we've covered how to enable and configure Dynamic DNS for popular no­ip.com 
and dyndns.com. We've seen the process in great depth and analysed all commands required 
to get the service up and running, but also debug it in case of problems.

Closing, we hope the article comes in handy and answers your questions regarding the 
configuration of DDNS on Cisco routers. 

If you have found the article useful, please take two minutes of your time and 'digg' the page!

Back To Technical Knowledgebase

You might also like