Difference between revisions of "OpenWRT DDNS"

3,485 bytes added ,  15:55, 8 October 2022
m
no edit summary
m
Line 1: Line 1:
READ THE BELOW "SPECIAL NOTES" SECTION FIRST!!! (to make sure some pre-requisites are taken care of)
This article was written about DDNS (Dynamic DNS (Domain Naming System (''not'' Service))) on OpenWRT, but some of it could apply to DDNS using other platforms.  On the server side, BIND / NAMED is used instead of the default OpenWRT DNS Daemon / Service, DNSMASQ.  DDNS-SCRIPTS is / are the service(s) used on the client side.
This article was written about DDNS (Dynamic DNS (Domain Naming System (''not'' Service))) on OpenWRT, but some of it could apply to DDNS using other platforms.  On the server side, BIND / NAMED is used instead of the default OpenWRT DNS Daemon / Service, DNSMASQ.  DDNS-SCRIPTS is / are the service(s) used on the client side.


Line 99: Line 101:
'''SPECIAL NOTES;'''
'''SPECIAL NOTES;'''


*'''Watch out if DNSMASQ isn't being used, IE BIND / NAMED and DHCPD are being used instead (see following bullet points for more)'''
*'''Do NOT use Netcat (remove if installed) and use the built in version available in BusyBox or install NCat and create some symbolic links (see following bullet points for more)'''
*The resolv.conf file is NOT 'updated' with a BIND / NAMED and DHCPD installation as it is with DNSMASQ.  Make sure the DHCPD /etc/init.d startup script has been modified to compensate.
**/etc/init.d/dhcpd: ln -sf "/tmp/resolv.conf.d/resolv.conf.auto" /tmp/resolv.conf (in the stop section, see [[Linksys AC Series Router Configuration Tips for OpenWRT|main WRT Series]] article on this subject)
**Also create a symbolic link in Startup
*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)''
*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)
*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)
*dns_server Directive / Parameter
**First, below is the official OpenWRT explanation for this setting;<syntaxhighlight lang="text">
Since CC 15.05 Normally the current (in the internet) registered ip is detected using the local defined name lookup policies (i.e. /etc/resolve.conf etc.)
Specify here a DNS server to be used instead of the defaults.
You can use FQDN, hostname or IP address.
</syntaxhighlight><br />
**OK.  Question.  What F*!& does that mean?  Hmmm.  Let's rephrase: By default, the OpenWRT DDNS Client uses the DNS server for the WAN interface (defined via DHCP or as a 'Custom DNS Server')
**...let's go on and actually give an explanation for what the F$J! it does:
*DHCPD and RESOLV.CONF
**If one chooses to use a ''full'' DNS Server and a full DHCP Server, such as BIND / NAMED and DHCPD, instead of DNSMASQ (perfectly wonderful, great, compact, fast, DNS Server), some issues arise.  See
*NETCAT "Full Version" VS NETCAT "BusyBox" Version VS NCAT
**First issue seems to be that something in OpenWRT v22.x.Whatever breaks NETCAT v0.7.1.  Speaking of NETCAT v0.7.1, the version of NETCAT in OpenWRT v22.x.Whatever is the same as OpenWRT v19.0.x, and earlier.  OpenWRT's problem?  Nope.  Netcat appears to have been last updated in 2004 with 0.7.1 being the latest version.  So what does OpenWRT do?  They do a great job in replacing it with NCAT.  And they keep it updated (v7.70 in OpenWRT 19.0.7 and v7.91 in OpenWRT 22.x.Whatever).  What they don't do is include a script that creates a symbolic link or overriding or whatever needs to be done to replace the version of NETCAT included with BusyBox.  IE, when NETCAT (as in the ancient 0.7.1 version) is installed, that replaces / overrides the BusyBox version of NETCAT.  Not so when installing NCAT.  Why not?  Who knows.  The solution is to do it yourself.  See
**Best as can be determined is that OpenWRT uses the PATH variable to control whether a BUSYBOX version or 'Full" Command version is used.  IE, when a command is run, the /USR/BIN Directory is searched first, if nothing is found, then the BusyBox version of the command is used.  Works great, if that's the strategy.  The really, really big issue is that unlike when installing the NCAT utility is installed, OpenWRT does NOT create a symbolic link from the NC Command to NCAT, instead leaving the NC symbolic link pointing to the Busybox version of the command.  So what should it do?  the below;
***nc > ncat (ln -s /usr/bin/ncat /usr/bin/nc)
***netcat > ncat (ln -s /usr/bin/ncat /usr/bin/netcat)
***Just so you know, the default is nc > ../../bin/busybox (with busybox NC implied)


====Configuration for Server====
====Configuration for Server====