Reply
Member
Posts: 207
Registered: ‎04-22-2013
Kudos: 228
Solutions: 2

Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Hi,

I have managed to find a solution to using DDNS from behind a NAT router. This came from some searching Vyatta forums. When you set up DDNS from behind a NAT router, your DDNS client regsiters your private address instead of the public one. As shown by the "show dns dynamic status" command issued out of config mode.

In order to work around this you need to edit a file by issuing the command below.

sudo -u root vi /opt/vyatta/sbin/vyatta-dynamic-dns.pl

press "a" to put you in edit mode

remark out the line below (it was line 107 in my file) by adding # in front of the line as below

$output .= "use=if, if=$interface\n\n\n";

add the following line below

$output .= "use=web, web=checkip.dyndns.com/, web-skip='IP Address: '\n";

save the file by pressing escape key to put you in command mode and typing

:wq

Now when you enter the following DDNS commands, you should have success

set service dns dynamic interface eth1 service dyndns host-name YOURHOST.DOMAIN.COM
set service dns dynamic interface eth1 service dyndns server dynupdate.no-ip.com
set service dns dynamic interface eth1 service dyndns login YOURUSERNAME
set service dns dynamic interface eth1 service dyndns password YOURPASSWORD

Success should look like this

show dns dynamic status

interface : eth1
ip address : x.x.x.x (external address)
host-name : YOURHOST.DOMAIN.COM
last update : Thu Jan 1 01:00:00 1970
update-status: good

Ignore the fact that the date is wrong

Hope that helps someone. Good luck

 

Marty

 

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5411
Solutions: 1657
Contributions: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

This is great! We'll look into whether/how we can integrate this into the DDNS function. Thanks for the contribution!

New Member
Posts: 3
Registered: ‎10-01-2013

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Awesome, great find. I was working on this issue since Friday of last week. I am now able to use dns-o-matic to update my no-ip.com and opendns.com accounts. This router is the best once you get a custom to the CLI since the GUI does not give you that many oprtions. No custom dd-wrt on a Linksys router anymore.Ubnt Banana 

New Member
Posts: 13
Registered: ‎09-20-2013
Kudos: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Awesome.  I can confirm dns-o-matic updates work perfect.  Just replaced checkip.dyndns.com to myip.dnsomatic.com and filled in the config with dnsomatic settings instead.   

Regular Member
Posts: 333
Registered: ‎03-31-2013
Kudos: 216
Solutions: 20

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Thanks for this hack. It really saved some headaches for me (multiple DDNS updating).

Just to clear things out for DNS-O-MATIC. The working setup should be as follows:


1. Editing of /opt/vyatta/sbin/vyatta-dynamic-dns.pl is as discribed above

2. The following dynamic dns commands configure DNS-O-MATIC correctly:

set service dns dynamic interface pppoe0 service dyndns host-name all.dnsomatic.com
set service dns dynamic interface pppoe0 service dyndns login YOUR-DNSOMATIC-USERNAME
set service dns dynamic interface pppoe0 service dyndns password YOUR-DNSOMATIC-PASSWORD
set service dns dynamic interface pppoe0 service dyndns server updates.dnsomatic.com

 Please note that I am using pppoe and not an eth connection.

For future reference, any update of the firmware will overwrite the "hack" - i.e. the vi commands should be repeated

 


Marcos
Highlighted
New Member
Posts: 3
Registered: ‎09-05-2014
Kudos: 1

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Why this is still necessary on recent versions of EdgeOS? I have a client with a EdgeRouter Lite v1.5.0 and I have to do this hack to get this working.

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5411
Solutions: 1657
Contributions: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Yeah it is on our TODO list to implement a more general mechanism, perhaps a config option for such a scenario (router behind another NAT device). Thanks for your feedback.

Emerging Member
Posts: 49
Registered: ‎11-10-2014
Kudos: 19
Solutions: 1

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

This “hack” should be the default because it also works even if you aren’t behind another router. Someone at Ubiquiti needs to change this.

Member
Posts: 207
Registered: ‎04-22-2013
Kudos: 228
Solutions: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Exactly right! It works for all situations so it should just be added to the code.

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5411
Solutions: 1657
Contributions: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Yes understand it can work in both scenarios. However the specific change is using "checkip.dyndns.com" for lookup and we'll need to look into whether that's acceptable as a default for all our routers or might get us in trouble (similar to defaulting to some public NTP server without permissions). Thanks for the feedback.

Emerging Member
Posts: 49
Registered: ‎11-10-2014
Kudos: 19
Solutions: 1

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Thanks for explaining what that script file does. It lead me to the solution of my DDNS problem of two services that require the same protocol.

 

http://community.ubnt.com/t5/EdgeMAX/DDNS-two-services-requiring-Dyndns-service-type-protocol-dyndns...

 

New Member
Posts: 2
Registered: ‎01-21-2015

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

I need to revive this thread with update to EdgeOS v1.6.0.  Prior to updating to latest version this script hack worked flawlessly.  Upon updating, I had to redo the changes to the vyatta-dynamic-dns.pl script but now they don't work.  It is still showing the internal address of ETH0

 

Does anyone know how to make this work again?

CropperCapture[42].png
CropperCapture[43].png
Member
Posts: 207
Registered: ‎04-22-2013
Kudos: 228
Solutions: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Take a look at the beta v1.7 I think they have added the functionality for external DDNS addresses to it.

 

I know it is not what you asked for (v1.6) but it might be an option.

 

http://community.ubnt.com/t5/EdgeMAX-Beta/Alpha-release-v1-7-0alpha1/m-p/1143832#U1143832

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5411
Solutions: 1657
Contributions: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Yeah the "web" and "web-skip" options can now be configured in v1.7.0alpha1 (see release notes for more information).

New Member
Posts: 5
Registered: ‎04-28-2015
Kudos: 1

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Would really like to see the dynamic dns account credential passwords obfuscaed/hashed in the config...


set service dns dynamic interface eth0 service dyndns password HELLOIMPLAINTEXT

New Member
Posts: 12
Registered: ‎07-21-2014

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

dyn.com (formerly dyndns.org) has an updater key, that, while plaintext, is not the account managment password, so can only be used as a password for updaters.  Not a full solution for properly obfuscating passwords in configs, but will keep your account management safe in the meantime.

Screen Shot 2015-05-16 at 4.03.58 PM.png
New Member
Posts: 16
Registered: ‎07-26-2012
Kudos: 3

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

I was banging my head against the wall with this one for a little while, im currently running v1.6 firmware

 

From original guide:

$output .= "use=web, web=checkip.dyndns.com/, web-skip='IP Address: '\n";

 

To this: (As DynDNS checkip.dyndns.com site has changed)

$output .= "use=web, web=checkip.dyndns.com/, web-skip='Current IP Address: '\n";




And when configuring the service

set service dns dynamic interface eth1 service dyndns server dynupdate.no-ip.com


To this:

set service dns dynamic interface eth1 service dyndns server dynupdate.noip.com


Also it doesn’t seem to like special characters in the password for noip.

 

New Member
Posts: 4
Registered: ‎02-11-2014
Kudos: 5

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

[ Edited ]

Under the version 1.7.0 it's mucth easier:

Simply go to the services Tab:

 

Captura de Tela 2015-07-05 às 16.44.00.png

 

Under  Dns in the Dynamic DNS

 

  1. Choose the interface (in my case pppoe0)
  2. Choose the web dyndns
  3. Insert the text that should be ignored in Web-skip "Current IP Address: " (don't forget the space or it will not work!!)
  4. In service combo-box choose "custom - " and give a name "NoIp"
  5. Input your hostname
  6. Input your Login
  7. Input your Password
  8. In Protocol combo-box choose "noip "
  9. in Server input "dynupdate.no-ip.com"
  10. Press Apply button and you are ready to go!
New Member
Posts: 16
Registered: ‎07-26-2012
Kudos: 3

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

Nice one, seems like ubnt are listening to people's requests. Any ideas on release dates for v1.7 stable?
Emerging Member
Posts: 44
Registered: ‎12-21-2014
Kudos: 2

Re: Dynamic DNS (DDNS) from behind a NAT (ADSL router). No-IP.com - WORKING

its already out Man Very Happy
Reply