{"id":724,"date":"2016-05-21T10:48:23","date_gmt":"2016-05-21T02:48:23","guid":{"rendered":"https:\/\/networkingnotesblog.wordpress.com\/?p=724"},"modified":"2016-05-21T10:48:23","modified_gmt":"2016-05-21T02:48:23","slug":"using-dynamic-dns-at-srx-with-non-dyndns-service-provider","status":"publish","type":"post","link":"http:\/\/notes4it.com\/?p=724","title":{"rendered":"Using dynamic DNS at SRX with non DYNDNS service provider"},"content":{"rendered":"<p>When placing a network equipment without a static IP address, the best way to remote access to the device is by using the dynamic DNS service. Juniper has import this feature into their network security products such as Netscreen ScreenOS and JunOS SRX.<br \/>\nI recently has replaced my SSG with the SRX, and am having trouble updating the DDNS record with the built-in DDNS feature. What happen is SRX only offer 2 options of &#8220;dyndns.org or ddo.jp&#8221;, any service other than these 2 are out of questions. Since I am using HE.net for DDNS, that does not do my any good.<br \/>\n&nbsp;<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-srx_ddns_server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-728\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-srx_ddns_server.png\" alt=\"20160521-DDNS-SRX_DDNS_server\" width=\"700\" height=\"161\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-srx_ddns_server.png 753w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-srx_ddns_server-300x69.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><br \/>\nSo my work around is: to map the dyndns domain name to a HE.net dns server IP address with the following command. The command below is to bind the members.dyndns.org (the dyndns.org DDNS service domain name) to the IP address of 184.105.242.3 (the DDNS service domain name).<!--more--><br \/>\n&nbsp;<br \/>\nset system static-host-mapping members.dyndns.org inet 184.105.242.3<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-ping_updated_ip.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-730 alignleft\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-ping_updated_ip.png\" alt=\"20160521-DDNS-ping_updated_ip\" width=\"625\" height=\"79\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-ping_updated_ip.png 625w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-ping_updated_ip-300x38.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\nResult: The last response = nochg. It means the ddns is updated to the DDNS service and the IP address remain unchange. So this is a positive result in our case.<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns_show_ddns_result.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-727 alignleft\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns_show_ddns_result.png\" alt=\"20160521-DDNS_show_ddns_result\" width=\"637\" height=\"66\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns_show_ddns_result.png 637w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns_show_ddns_result-300x31.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/a><br \/>\nReaders might have a question of &#8221; hey, the result is showing member.dyndns.org, how do i know this service is updated to he.net DDNS server?&#8221;<br \/>\nBy pinging the member.dyndns.org, we know the IP address of this domain name is 204.13.248.111. This result is captured before applying the static IP address mapping.<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-dyndns_ip.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-725 alignleft\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-dyndns_ip.png\" alt=\"20160521-DDNS-dyndns_IP\" width=\"651\" height=\"57\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-dyndns_ip.png 651w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-dyndns_ip-300x26.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<hr \/>\n<p>Troubles went through before getting this work.<br \/>\n1st failed attempt:<br \/>\nBefore coming up with the domain name\u00a0 to IP static mapping solution. I was thinking of using a plain old mapping at \/etc\/hosts. It seems to be working fine when I add the mapping at the hosts file below.<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-etchost.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-726\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-etchost.png\" alt=\"20160521-DDNS-etchost\" width=\"631\" height=\"157\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-etchost.png 631w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-etchost-300x75.png 300w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/a><br \/>\nBut once I apply a new configuration at the SRX, the DDNS service does not able to update, because the last response shown as &#8220;badauth&#8221;. So I do the ping and dump, and found that the member.dyndns.org has changed back to the original IP address, and the static mapping at hosts file was gone.<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-show_ddns_bad_result.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-729 alignleft\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-show_ddns_bad_result.png\" alt=\"20160521-DDNS-show_DDNS_bad_result\" width=\"627\" height=\"66\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-show_ddns_bad_result.png 627w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-show_ddns_bad_result-300x32.png 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/a><a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-dyndns_ip.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-725 alignleft\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-dyndns_ip.png\" alt=\"20160521-DDNS-dyndns_IP\" width=\"651\" height=\"57\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-dyndns_ip.png 651w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-dyndns_ip-300x26.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\nTCPDUMP when using static map at \/etc\/hosts file:<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-tcpdump_before.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-732\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-tcpdump_before.png\" alt=\"20160521-DDNS-tcpdump_before\" width=\"700\" height=\"126\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_before.png 1343w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_before-300x54.png 300w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_before-1024x184.png 1024w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_before-768x138.png 768w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><br \/>\nTCPDUMP after apply static map at configuration file:<br \/>\n<a href=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-tcpdump_after.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-731\" src=\"https:\/\/networkingnotesblog.files.wordpress.com\/2016\/05\/20160521-ddns-tcpdump_after.png\" alt=\"20160521-DDNS-tcpdump_after\" width=\"700\" height=\"139\" srcset=\"http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_after.png 1345w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_after-300x60.png 300w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_after-1024x203.png 1024w, http:\/\/notes4it.com\/wp-content\/uploads\/2016\/05\/20160521-ddns-tcpdump_after-768x152.png 768w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><br \/>\n2nd failed attempt:<br \/>\nSince mapping the &#8220;members.dyndns.org&#8221; to &#8220;HE.net IP address&#8221; could be a solution, but IP binding record will change from time to time, and it might become non-functionable if HE.net has updated or change their dyn.dns.he.net IP record. I have decided to map an alias of &#8220;members.dyndns.org&#8221; to &#8220;dyn.dns.he.net&#8221; to overcome this issue.\u00a0 But the out come mapping alias does not work as expected. After mapping the alias, the &#8220;member.dyndns.org&#8221; did not associated to the &#8220;dyn.dns.he.net&#8221; IP address as planned. So I have abandon this case.<br \/>\nset system static-host-mapping members.dyndns.org alias dyn.dns.he.net<br \/>\nawong@SRX-Gateway# run ping members.dyndns.org<br \/>\nPING members.dyndns.org (204.13.248.111): 56 data bytes<br \/>\n64 bytes from 204.13.248.111: icmp_seq=0 ttl=49 time=234.277 ms<br \/>\n64 bytes from 204.13.248.111: icmp_seq=1 ttl=49 time=230.672 ms<\/p>\n<hr \/>\n<p>Conclusion:<br \/>\nAlthough the Juniper SRX device does not provide other Dyndns service provider options nor allow custom DDNS setting, the work around of mapping the member.dyndns.org to the third party DDNS provider could be an option too. This work around has a major issue of not able to update the DDNS record if third party DDNS provider updates their DDNS service IP address binding. Therefore a frequents manual IP address check is required by the user who use this approach.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When placing a network equipment without a static IP address, the best way to remote access to the device is by using the dynamic DNS service. Juniper has import this feature into their network security products such as Netscreen ScreenOS and JunOS SRX. I recently has replaced my SSG with the SRX, and am having [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[34,42,60,79,90,169,173],"class_list":["post-724","post","type-post","status-publish","format-standard","hentry","category-networking","tag-ddns-en","tag-dynamic-dns-en","tag-he-net-en","tag-ip-binding-en","tag-juniper-en","tag-srx-en","tag-static-host-mapping-en"],"_links":{"self":[{"href":"http:\/\/notes4it.com\/index.php?rest_route=\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/notes4it.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/notes4it.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/notes4it.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/notes4it.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=724"}],"version-history":[{"count":0,"href":"http:\/\/notes4it.com\/index.php?rest_route=\/wp\/v2\/posts\/724\/revisions"}],"wp:attachment":[{"href":"http:\/\/notes4it.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/notes4it.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/notes4it.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}