OpenWRT DDNS: Difference between revisions

Line 44: Line 44:
config service 'WhatEverArbitraryName'
config service 'WhatEverArbitraryName'
option service_name 'bind-nsupdate'
option service_name 'bind-nsupdate'
option lookup_host 'WhatEverHostName.WhatEverDomain.COMorNETorORGorETC'
option lookup_host 'WhatEverHostName.WhatEverDomainName.WhatEverSuffix'
option username 'WhatEverUserName'
option username 'WhatEverUserName'
option password 'WhatEverMD5EncryptedPassword'
option password 'WhatEverMD5EncryptedPassword'
option domain 'WhatEverHostName.WhatEverDomain.COMorNETorORGorETC'
option domain 'WhatEverHostName.WhatEverDomainName.WhatEverSuffix'
option enabled '1'
option enabled '1'
option ip_source 'web'
option ip_source 'web'
Line 54: Line 54:
option force_ipversion '1'
option force_ipversion '1'
option interface 'wan'
option interface 'wan'
option dns_server 'WhatEverDNSServer.WhatEverDomain.COMorNETorORGorETC'
option dns_server 'WhatEverDNSServer.WhatEverDomainName.WhatEverSuffix'


</syntaxhighlight>
</syntaxhighlight>
It was found that WGET did not work reliably in situation where the router running the DDNS Client Scripts with a private WAN IP Address was behind another router with a public WAN IP Address.  So CURL was used to address the issue.  DD-WRT addresses this very issue with a radio button choice titled "Do not use external ip check" (worded poorly as negative questions are always a bit confusing), but OpenWRT offers no similar configuration via its GUI or in the configuration file (/etc/config/ddns).
It was found that WGET did not work reliably in situation where the router running the DDNS Client Scripts with a private WAN IP Address was behind another router with a public WAN IP Address.  So CURL was used to address the issue.  DD-WRT addresses this very issue with a radio button choice titled "Do not use external ip check" (worded poorly as negative questions are always a bit confusing), but OpenWRT offers no similar configuration via its GUI or in the configuration file (/etc/config/ddns).
==== Additional Configuration Example for a Router with Dual WAN Capability ====
The below example assumes the WAN interfaces (OpenWRT perspective, not from ''ifconfig'' perspective) are "wan" and "wwan"<syntaxhighlight lang="text">
config ddns 'global'
option ddns_dateformat '%F %R'
option ddns_loglines '250'
option upd_privateip '0'
option use_curl '1'
config service 'WhatEverArbitraryName'
option service_name 'bind-nsupdate'
option lookup_host 'WhatEverHostName.WhatEverDomainName.WhatEverSuffix'
option username 'WhatEverUserName'
option password 'WhatEverMD5EncryptedPassword'
option domain 'WhatEverHostName.WhatEverDomainName.WhatEverSuffix'
option enabled '1'
option ip_source 'web'
option ip_url 'https://domains.google.com/checkip'
option bind_network 'wan'
option force_ipversion '1'
option interface 'wan'
option dns_server 'WhatEverDNSServer.WhatEverDomainName.WhatEverSuffix'
config service 'WhatEverArbitraryName2'
option service_name 'bind-nsupdate'
option lookup_host 'WhatEverHostName2.WhatEverDomainName.WhatEverSuffix'
option username 'WhatEverUserName'
option password 'WhatEverMD5EncryptedPassword'
option domain 'WhatEverHostName2.WhatEverDomain.WhatEverDomainName.WhatEverSuffix'
option enabled '1'
option ip_source 'web'
option ip_url 'https://domains.google.com/checkip'
option bind_network 'wwan'
option force_ipversion '1'
option interface 'wwan'
option dns_server 'WhatEverDNSServer.WhatEverDomainName.WhatEverSuffix'
</syntaxhighlight>'''SPECIAL NOTES;'''
* The OpenWRT DDNS Scripts do NOT like or tolerate dashes or hyphens ( - ) in the service name (IE: ''config service 'What-Ever-Name' will not work and result in nothing showing up in the LuCI GUI)''
* DDNS Scripts (and maybe BIND / NAMED) do NOT like or tolerate underscores ( _ ) in the ''lookup_host'' or ''domain'' directives (IE: What_Ever_Host_Name.WhatEverDomain.WhatEverSuffix will cause an error)


===Configuration for Server===
===Configuration for Server===
Line 70: Line 110:
The DDNS Script on the client will also complain that the "password isn't complex enough", but will still function, if a value of less than 512 is used in the above command.
The DDNS Script on the client will also complain that the "password isn't complex enough", but will still function, if a value of less than 512 is used in the above command.


==== Directives for /etc/bind/named.conf ====
Other utilities, noted [https://bind9.readthedocs.io/en/v9_16_5/advanced.html here], such as ''tsig-keygen'' and ''ddns-confgen'' can also generate the appropriate "user name" / "password".  But they are not available in any OpenWRT packages.
 
====Directives for /etc/bind/named.conf====


Below are the directives to add to named.conf (in OpenWRT, the path is /etc/bind/named.conf);<syntaxhighlight lang="text">
Below are the directives to add to named.conf (in OpenWRT, the path is /etc/bind/named.conf);<syntaxhighlight lang="text">