OpenWrt Forum Archive

Topic: luci-app-ddns / ddns-scripts : I'm working on enhancements

The content of this topic has been archived between 23 Mar 2018 and 4 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Luci on my side still shows the old address:
test_extern   
ayankeeindixie.spdns.de
2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
disabled

dig run from openwrt.  First time is answered by 127.0.0.1 (dnsmasq?) second is answered by google.

root@OpenWrt ddns# date;dig aaaa ayankeeindixie.spdns.de
Sun Jul 27 13:19:28 CDT 2014

; <<>> DiG 9.9.4 <<>> aaaa ayankeeindixie.spdns.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62571
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ayankeeindixie.spdns.de.    IN    AAAA

;; ANSWER SECTION:
ayankeeindixie.spdns.de. 1121    IN    AAAA    2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Jul 27 13:19:28 CDT 2014
;; MSG SIZE  rcvd: 80

root@OpenWrt ddns# date;dig aaaa @2001:4860:4860::8888 ayankeeindixie.spdns.de
Sun Jul 27 13:20:30 CDT 2014

; <<>> DiG 9.9.4 <<>> aaaa @2001:4860:4860::8888 ayankeeindixie.spdns.de
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16217
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ayankeeindixie.spdns.de.    IN    AAAA

;; ANSWER SECTION:
ayankeeindixie.spdns.de. 1200    IN    AAAA    2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa

;; Query time: 5 msec
;; SERVER: 2001:4860:4860::8888#53(2001:4860:4860::8888)
;; WHEN: Sun Jul 27 13:20:35 CDT 2014
;; MSG SIZE  rcvd: 69

root@OpenWrt ddns#


You are seeing the updates take place, so your script is making the change.  My Luci does not see the change take place (even though it has).

Running from my laptop, the first dig is reported from dnsmasq and has the old address, the second when asking google, can't find a server.

bill@sligo:~$ date;dig aaaa ayankeeindixie.spdns.de
Sun Jul 27 13:30:09 CDT 2014

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> aaaa ayankeeindixie.spdns.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13157
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ayankeeindixie.spdns.de.    IN    AAAA

;; ANSWER SECTION:
ayankeeindixie.spdns.de. 480    IN    AAAA    2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa

;; Query time: 0 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Jul 27 13:30:09 2014
;; MSG SIZE  rcvd: 69

bill@sligo:~$ date;dig aaaa @2001:4860:4860::8888 ayankeeindixie.spdns.de
Sun Jul 27 13:30:22 CDT 2014

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> aaaa @2001:4860:4860::8888 ayankeeindixie.spdns.de
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
bill@sligo:~$

I have the default dnsnasq.conf file, so it is still using the nameserver of 127.0.0.1 as specified in /etc/resolv.conf

Do I need to reenable specific nameservers and exclude the /etc/resolv.conf file?  I'm not understanding why dig from the laptop can't find a server.

In the meanwhile I did some test with my box using "host" command using the diag script with additions
From the update send it takes 43 seconds until the first detect at goggle dns and additional 4 minutes undtil the answer was stabil for 40 seconds.
So overall time takes 5 minutes to an stabil answer.

OK our posts cross.
try "host" command on your laptop, are fiefferences to dig ?
you need to specify a nameserver in lapstop's command because otherwise it will use dnsmasq from router, same problem like the router without nameserver.

Its been longer than 5 minutes since the script ran.

root@OpenWrt ddns# host ayankeeindixie.spdns.de.
ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
root@OpenWrt ddns# host -6 ayankeeindixie.spdns.de.
ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
root@OpenWrt ddns# host -6 ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
root@OpenWrt ddns#


From the laptop

bill@sligo:~$ host -6 ayankeeindixie.spdns.de. 2001:4860:4860::8888
;; connection timed out; no servers could be reached
bill@sligo:~$ host ayankeeindixie.spdns.de. 2001:4860:4860::8888
;; connection timed out; no servers could be reached


Do I have something misconfigured?  Would you want to take a look at my files and ensure I haven't gotten something messed up?

Try host command without "-6" from your laptop. Or second try use 8.8.8.8 as dns-server with and without "-6"
scripts looking ok.
On my side LuCi shows 2001:4860:4860::8888 for "test_extern"

I'm convinced that my problem resides within the Hughes modem.  I don't know what it is, nor do I know how to fix it.

I wanted to bypass the routers configuration (in case I had something wrong) so I plugged directly into the Hughes modem.

sligo bill # host ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
sligo bill # host -6 ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
sligo bill # host ayankeeindixie.spdns.de 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa
sligo bill # host -6 ayankeeindixie.spdns.de 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: ::ffff:8.8.8.8#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:5b0:2d5a:a8d0:c63d:c7ff:fe97:f0fa


I then rebooted the Hughes modem and tried again:

sligo bill # host -6 ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:4860:4860::8888
sligo bill # host ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:4860:4860::8888


I have reconnected the router and Luci now shows:
test_extern
ayankeeindixie.spdns.de
2001:4860:4860::8888
disabled

Again from the laptop, with the router plugged back into the modem.

sligo bill # host ayankeeindixie.spdns.de. 2001:4860:4860::8888
;; connection timed out; no servers could be reached
sligo bill # host -6 ayankeeindixie.spdns.de. 2001:4860:4860::8888
;; connection timed out; no servers could be reached

Again running in a console window of the router, after a modem reboot:
root@OpenWrt ddns# host ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:4860:4860::8888
root@OpenWrt ddns# host -6 ayankeeindixie.spdns.de. 2001:4860:4860::8888
Using domain server:
Name: 2001:4860:4860::8888
Address: 2001:4860:4860::8888#53
Aliases:

ayankeeindixie.spdns.de has IPv6 address 2001:4860:4860::8888
root@OpenWrt ddns#

I'll make a bet and say that I'll continue to see the Google address until I reboot the modem again.

It looks your modem is caching port 53 dns requests for what ever reason. independet from the dns server you use. Or it redirects any port 53 request to it's own dns-server cache server to reduce traffic. Don't know.
So for the moment we can say it's not an nslookup vs. host vs. dig problem.
Updates are send correctly to the server HE and spdns because I can see them from the other end of the world.

I start test_extern script checking every 30 minutes for changes and (re)set to my own Pv6.

Have a nice sunday afternoon, I will have a hard monday.

Christian

Chris,

I've been looking through files of the Advanced Installation for the Hughes Modem.  I do not know what I'm looking at.  But I have come across some entries with names that I recognize.  How or if they relate to what we are doing, I don't know.  From the wording, I would think this only applies to maintenance of the modem.  But because they mention what we are playing with, I thought I'd share.

[DNS]
# Management DNS Domain of: jupiter.hnops.net
ManagementDomain=jupiter.hnops.net
# Terminal FQDN DNS Domain Name for dynamic DNS entry for management naming
TerminalManagementDomain=terminal.jupiter.hnops.net
# Dynamic DNS for Terminal for own DNS entries (outgoing DNS is in RA instead)
DynamicDNSServer=VMWJUPDNS21.terminal.jupiter.hnops.net
[Commissioning and Registration]

I'll need to contact Hughes and ask.  I'm having issues with their website, so I'll probably need to call them.  Past experience has shown that you can't get answers the first time.  Many times I know more about networking than their Customer Reps, so the requests need to be forwarded to their Engineers, for me to get answers.  Last time I tried, the process took over a week before I got an answer.

Bill

Hi Bill,

open a new thread here in the forum or in "General Discussion". Something like "Hughes modem - DNS problems"
because the community might not monitor in detail our problems. Try to Google if something is around outside OpenWrt project.

Good Luck
Christian

Chris,

I believe I've found a solution to our problem.

First, here's a link seeking help from this forum, as you suggested.  It did not receive a response, I'm including it here, just to be complete.
https://forum.openwrt.org/viewtopic.php … 58#p242058

I did find a post on the Hughes forum:
https://community.myhughesnet.com/hughe … _responses
This post indicates that the Hughes HT-1000 modem is caching DNS querries.  He suggests a solution is to send the querries via TCP rather than UDP.

I've done some playing and this seems to work.  I've made some changes to your scripts to experiment with (I'm not as elegant as you, you'll probably want to double check my changes)

host_dig-check-new-address.sh

#!/bin/sh
while : ; do
    date
    echo "############### host output ###########################"
    host -T -t aaaa -6 ayankeeindixie.spdns.de google-public-dns-a.google.com
    echo "**************** dig output ****************************"
    dig @google-public-dns-a.google.com -t aaaa -6 ayankeeindixie.spdns.de +tcp
    echo "-------------------------------------------------------"
    sleep 10
done

dynamic_ddns_diaghelper-change6-dig_+tcp_he-addr.sh

#!/bin/sh
#set -vx    # script-debugger

### Please uncomment the line with the NAMESERVER to use or edit on
### no spaces around "=" and don't forget double quotes around name or ip address
# NAMESERVER=""                    # take the systems default
# NAMESERVER="localhost"            # local machine
# NAMESERVER="resolver1.opendns.com"        # opendns public dns
# NAMESERVER="google-public-dns-a.google.com"    # Google public dns
# NAMESERVER="ordns.he.net"            # Hurricane Electric public dns
# NAMESERVER="ns1.he.net"            # not a public dns-server
# NAMESERVER="palmnut-dns.exetel.com.au"        # Australian DNS server

NAMESERVER="google-public-dns-a.google.com"


### Put here the data from your DDNS Provider (between double quotes)
DOMAIN="ayankeeindixie.spdns.de"
USERNAME="ayankeeindixie.spdns.de"
PASSWORD="ifgh-mlpz-qbzb"
### IP to send to your provider - Valid IPv4 or IPv6 address
IP="2001:470:20::2"    

# Hurricane Electric Dynamic DNS
# URL="http://$DOMAIN:$PASSWORD@dyn.dns.he.net/nic/update?hostname=$DOMAIN&myip=$IP" 

# Securepoint Dynamic-DNS-Service    (http://www.spdns.de)
URL="http://$USERNAME:$PASSWORD@update.spdns.de/nic/update?hostname=$DOMAIN&myip=$IP"

##### PLEASE NO CHANGES BLOW THIS LINE #########################################

IP_REGEX="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
IPV4=$(echo $IP | grep -m 1 -o "$IP_REGEX")
[ -z "$IPV4" ] && IP_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)"

TIME=0
echo ""
/usr/bin/wget -q -O - "$URL" || {
    echo -e "\n\tERROR updating your DDNS provider ! Check parameters !\n"
    exit 1    # exit on error
}

echo -e "\n\tWaiting for IP change of '$DOMAIN' on nameserver '$NAMESERVER'"
#************* changed host command to dig with specific options billmc ***************
# START_IP=$(host $DOMAIN $NAMESERVER) || {
START_IP=$(dig @$NAMESERVER -t aaaa -6 $DOMAIN +tcp ) || {
#**************************************************************************************
    echo -e "\n\tERROR in nslookup ! Please check error message !\n"
    exit 1    # exit on error
}
######## Following changes per Chris' directions #########################
#START_IP=$(echo "$START_IP" | sed '1,2d' | grep -o "Name:\|Address.*" | grep -m 1 -o "$IP_REGEX")
START_IP=$(echo "$START_IP" | grep "$DOMAIN" | grep -m 1 -o "$IP_REGEX")
############################################################################

date
echo -e "\tCurrentIP: $START_IP"
[ -z $START_IP ] && exit 1

STOP_IP=$START_IP
until [ "$START_IP" != "$STOP_IP" ]; do
    sleep 1
######## Following changes per Chris' directions #########################
#    STOP_IP=`nslookup $DOMAIN $NAMESERVER 2>/dev/null | sed '1,2d' | grep -o "Name:\|Address.*" | grep -m 1 -o "$IP_REGEX"`
#************* changed host command to dig with specific options billmc ***************
# STOP_IP=`host $DOMAIN $NAMESERVER 2>/dev/null | grep "$DOMAIN" | grep -m 1 -o "$IP_REGEX"`
 STOP_IP=`dig @$NAMESERVER -t aaaa -6 $DOMAIN +tcp 2>/dev/null | grep "$DOMAIN" | grep -m 1 -o "$IP_REGEX"`
#**************************************************************************************
############################################################################

    TIME=$(( $TIME + 1 ))
    echo -n -e "\b\b\b\b\b\t$TIME"
done
echo -n -e "\b\b\b\b\b"
echo -e "\t    NewIP: $STOP_IP"
echo -e "\t     Time: $TIME loops (1 second wait time)\n"
date

dynamic_ddns_diaghelper-change7_host_-T_google-addr.sh

#!/bin/sh
#set -vx    # script-debugger

### Please uncomment the line with the NAMESERVER to use or edit on
### no spaces around "=" and don't forget double quotes around name or ip address
# NAMESERVER=""                    # take the systems default
# NAMESERVER="localhost"            # local machine
# NAMESERVER="resolver1.opendns.com"        # opendns public dns
# NAMESERVER="google-public-dns-a.google.com"    # Google public dns
# NAMESERVER="ordns.he.net"            # Hurricane Electric public dns
# NAMESERVER="ns1.he.net"            # not a public dns-server
# NAMESERVER="palmnut-dns.exetel.com.au"        # Australian DNS server

NAMESERVER="google-public-dns-a.google.com"


### Put here the data from your DDNS Provider (between double quotes)
DOMAIN="ayankeeindixie.spdns.de"
USERNAME="ayankeeindixie.spdns.de"
PASSWORD="ifgh-mlpz-qbzb"
### IP to send to your provider - Valid IPv4 or IPv6 address
IP="2001:4860:4860::8888"    

# Hurricane Electric Dynamic DNS
# URL="http://$DOMAIN:$PASSWORD@dyn.dns.he.net/nic/update?hostname=$DOMAIN&myip=$IP" 

# Securepoint Dynamic-DNS-Service    (http://www.spdns.de)
URL="http://$USERNAME:$PASSWORD@update.spdns.de/nic/update?hostname=$DOMAIN&myip=$IP"

##### PLEASE NO CHANGES BLOW THIS LINE #########################################

IP_REGEX="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
IPV4=$(echo $IP | grep -m 1 -o "$IP_REGEX")
[ -z "$IPV4" ] && IP_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)"

TIME=0
echo ""
/usr/bin/wget -q -O - "$URL" || {
    echo -e "\n\tERROR updating your DDNS provider ! Check parameters !\n"
    exit 1    # exit on error
}

echo -e "\n\tWaiting for IP change of '$DOMAIN' on nameserver '$NAMESERVER'"
#****************************changed host command to host -T to run over TCP***************************
# START_IP=$(host $DOMAIN $NAMESERVER) || {
START_IP=$(host -T -t aaaa -6 $DOMAIN $NAMESERVER) || {
#******************************************************************************************************
    echo -e "\n\tERROR in nslookup ! Please check error message !\n"
    exit 1    # exit on error
}
######## Following changes per Chris' directions #########################
#START_IP=$(echo "$START_IP" | sed '1,2d' | grep -o "Name:\|Address.*" | grep -m 1 -o "$IP_REGEX")
START_IP=$(echo "$START_IP" | grep "$DOMAIN" | grep -m 1 -o "$IP_REGEX")
############################################################################

date
echo -e "\tCurrentIP: $START_IP"
[ -z $START_IP ] && exit 1

STOP_IP=$START_IP
until [ "$START_IP" != "$STOP_IP" ]; do
    sleep 1
######## Following changes per Chris' directions #########################
#    STOP_IP=`nslookup $DOMAIN $NAMESERVER 2>/dev/null | sed '1,2d' | grep -o "Name:\|Address.*" | grep -m 1 -o "$IP_REGEX"`
#****************************changed host command to host -T to run over TCP***************************
# STOP_IP=`host $DOMAIN $NAMESERVER 2>/dev/null | grep "$DOMAIN" | grep -m 1 -o "$IP_REGEX"`
  STOP_IP=`host -T -t aaaa -6 $DOMAIN $NAMESERVER 2>/dev/null | grep "$DOMAIN" | grep -m 1 -o "$IP_REGEX"`
#******************************************************************************************************
############################################################################

    TIME=$(( $TIME + 1 ))
    echo -n -e "\b\b\b\b\b\t$TIME"
done
date

echo -n -e "\b\b\b\b\b"
echo -e "\t    NewIP: $STOP_IP"
echo -e "\t     Time: $TIME loops (1 second wait time)\n"

The date command in the while loop isn't needed.  I stuck it in so I had a reference as to when things took place, in order to compare when the updates took effect.  Although, I suppose you could display it in Luci as a refference as to when the last update occurred, this in addition to the countdown until the next forced update.

Specifying an aaaa record seemed to work better than not specifying it, but I don't know if its absolutely necessary.  I also specified IPv6.  This also seemed to work better for me than not specifying it.  Hughes has native IPv6 connectivity, while their IPv4 is NATed.  Other folks may not need to use these settings.

As a suggestion, like your did with the HTTPS selection in Luci.  Maybe you can make these switches optional, those that don't need it, wouldn't need to select them.  On that note, I did not try to send the updates with wget via HTTPS, I suppose we ought to try that.

I use both dig and host here, because they both support specifying IPv6.  Both seem to work.  I recall you saying that dig may be to large for some routers.  Again, for those that have the memory, maybe dig can be also set as an option, with a note stating the package would need to be loaded.

When running the check new addr script, it seemed like it took between 30 seconds to 2 minutes, after the update script finished running, before it showed an address change.  Like I said, I'm not very experienced with scripting, so there is most likely something in your script I didn't understand, or something I messed up.  Best to check.

Let me know what happens.
Bill

ps
At a later time, if you're willing to help with my education, maybe you could explain to me some of the lines of code in the script that I don't understand?

Hi Bill,

good to here that your "problems" are not mine  ;-) but many thanks for in deep testing.
So the scripts are working in general but some extensions seems to be needed.
1.) Support / use if installed bind-dig or bind-host
2.) if dig/host exist, enable/disable use of DNS-Request via TCP.
3.) Option for force the use of either IPv4 or IPv6 ("-4/-6" parameter in the used programs) if programs support this.
4.) include this into LuCI frontend
Something missing ?

This will take a while, but I will come back here if it is ready for testing.

For scripting start looking at http://www.grymoire.com/Unix/Sh.html
There are a lot of tutorials in the Web. But be carefully which shell you are talking about.
Bourne, Bash, Korn,...

Again many thanks
Christian

Chris,

Yeah, I know about the different shells.  When I was still working (I'm retired now) they favored the Korn shell (Solaris).  I wasn't writing them.  A few years back, I picked up a book on Bash scripting.  Its just that I do that sort of thing so infrequent, I never really get any practice at it.

The suggestions I made that I think you missed was the one for the date/time when the last update took place, in Luci, and requesting an AAAA record.  I'll be looking forward to getting my hands on what you come up with.  Because I've got native IPv6 and can't get a public IPv4 address, its the piece I'm missing for getting a web and mailserver setup.

I think I forgot to mention, that it seemed as if dig was more reliable than host.  Again, it could just be my network, but when I ran dig it always worked.  A couple of times host reported it couldn't find the nameserver.  That's why I'm suggesting using both.

Bill

Bill,

you can force Gnu Wget, cURL, dig, host with parameter -6 to use IPv6 (AAAA) (as you did) for the whole communication over proxies, DNS-Server etc.
That's one of the reasons why I currently not using -6 on wget or curl if using a proxy. I tested with my routers proxy and a public one which only had IPv4 addr. The communication did not happen if you set -6 and has servers in the middle only talking IPv4.
That's the Idea behind "force_ipversion" (??) to check that all componends has IPvX addresses.
Router -> Proxy -> DDNS provider -> DNS-Server -> Router.
There is programming to do in scripts and in LuCI where the user can set the data. They need to be checked before saving to config.

Date/Time of last,update is a question on space on the LuCI status page. Space was allready the reason to put information in 2 lines.
You also need to think about translations into other languages. I tried allready German an some things, English is "shorter".
The other point is that the only real timer that you can trust is uptime (OpenWrt NDP-Client is running). Uptime is also used by the original scripts. I simply reuse what was there. I will check what is possible to do.

Christian

Chris,

I only speak the one language, so I'm not accustomed to thinking about requirements of others.  I'm also very new to using OpenWRT, so I didn't realize there is a 2 line restriction.  I'm sure you'll do the best with what you've got.

The AAAA record and the -4 or -6.  Its my understanding that the protocol being used for transport, has nothing to do with the type of record requested.  I can send a request over IPv4, asking for and receiving a AAAA record.  I'd have to go back and test some more, but if I remember correctly, I didn't always get a correct response unless I specified AAAA.  I was not trying to say that a -6 automatically implied AAAA.  You probably have a better handle on DNS than I do.  But stuck in my head a host with an IPv6 address has to have a AAAA record.  It could have other records as well, CNAME, MX what have you.  But as a minimum it would have an AAAA record.  Maybe I'm not remembring correctly or maybe when I did not specify AAAA I received an old address, but I seem to recall that I had to add AAAA to the request if I wanted to ensure it was answered correctly.

Keep me posted as to what you come up with.

Hi Bill,

please send me an eMail (noted at the head of the scripts). I've rewritten the 2 scripts. LuCI adaption is not yet finished.

They now additional supports logfiles, DNS via TCP, forced IPv4 or IPv6 transfer also on DNS lookup using host or dig if installed.

Do you have time for testing ?

Christian

Chris,
I didn't find your email address, so I'm posting here instead.  I am available for testing.  (I found someone at google, not sure if it's you?)

I'm currently running hynman's r41988 build, which he says is based on Barrier Breaker rc2.  arokh has moved on and I wanted to stay with BB because of your scripts.  Let me know how to get the scripts and what I need to do to install them.
Bill

Yo Chris

Gorgeous work. Was just that close to begin some hack of my own.

I did find a bug, though. If you combine curl usage with $use_https and a bad $cacert path. What happens then is, $UPDATE_PROG gets set to "ERR_NOCERT -6" (or -4 that is), instead of just ERR_NOCERT. Which then gets run as command.

In dynamic_dns_functions.sh, checking curl's parameters should occur in the same order as for wget (Proxy before HTTPS).
Simply change the order of those two if-blocks.
Lines 157/168, for everyone who downloaded the file from the traq ticket.

Thanks for your reply.
Changed.

For everybody please no longer use this files. Will be implemented into trunk the next days.

Thanks for testing

(Last edited by chris5560 on 21 Sep 2014, 07:19)

I also suggest against the use of the services and services_ipv6 files separation.
If a service needs a different url to update, it should just be addes as a new service, imho, no need for a new file at all.

Another problem is that some services provide their update url only for ipv4 (e.g. afraid.org).
It makes of course sense to use v6 when updating a v6 record. But enforcing one protocol is only desirable when the service uses the updating source address as record.

I'm currently writing on improvements. Is it still worth it, or will the code in trunk be very different?

(Last edited by Tabis on 21 Sep 2014, 11:34)

I decide for 2 separate files because I has no chance to test all services against IPv6.
2nd reason is the written LuCI App which needs to know which version of ddns_scripts is installed.
OK there are additional bytes of flash wasted for a second file. Inside LuCI app It's easier to read from a seperate file when offering IPv6 services.
It's already hard as shell script to extract url for the service. (I take the code directly from current version of ddns-scripts)

Yes the code has many changes especially dynamic_dns_function.sh, but also many changes inside _updater.sh
It's all the result of testing with Bill (many thanks to him). We continued via direct mail to fix the problems.
please wait some days.

Yep, sounds reasonable. Meanwhile i've been looking and understanding a lot about luci and how these scripts work.

However, I made an addition that i would like to see in your patches: Fallback to IPv4 if the host has no IPv6 connection.

For everyone who's not gonna go to trunk anytime soon:

in dynamic_dns_updater.sh:
right after

UPDERR=0    # update fails max. 5 times retry then exit

add:
PROTO_FALLBACK=0
UPDATE_PROG_PREFB=$UPDATE_PROG

after:
        LASTERR=$?    # save the error code
add:
        # Fallback to IPv4 in case of ipv6 update on a ipv4 only server.
        if [ $PROTO_FALLBACK -eq 0 ]; then
            if [ $use_ipv6 -ne 0 ] && ((echo $UPDATE_PROG | grep -q '/curl ' && [ $LASTERR -eq 6 ] ) || (echo $UPDATE_PROG | grep -q '/wget ' && [ $LASTERR -eq 4 ] )); then
                verbose_echo "The service does not provide IPv6 access. Retrying with fallback to IPv4."
                PROTO_FALLBACK=1
                use_ipv6=0
                UPDATE_PROG="$(get_update_prog)"
                use_ipv6=1
                continue    # jump back to the beginning of while loop
            fi
        else
            PROTO_FALLBACK=0
            UPDATE_PROG=$UPDATE_PROG_PREFB
        fi

Hi chris5560,

Does your version of ddns scripts correctly implement the ip_source interface directive ?

Because, using the ddns-scripts 1.0.0-23 in CC trunk, I can't get OpenWrt to register different IPs for each WAN port in a multi-WAN setup.

...
option ip_source 'interface'
option ip_interface 'eth0.2'

...
option ip_source 'interface'
option ip_interface 'eth0.3'

kpv wrote:

Hi chris5560,

Does your version of ddns scripts correctly implement the ip_source interface directive ?

Because, using the ddns-scripts 1.0.0-23 in CC trunk, I can't get OpenWrt to register different IPs for each WAN port in a multi-WAN setup.

...
option ip_source 'interface'
option ip_interface 'eth0.2'

...
option ip_source 'interface'
option ip_interface 'eth0.3'

kpv,
I don't know if this is helpful or not.  In the /etc/config/ddns there needs to be a separate section for each address that is to be updated.  I haven't taken a look at the scripts that you mention, so I don't know how they compare to the last scripts I tested for Chris.  I can say, that with the scripts that I currently have (I don't have anything new for LuCi, so all my stuff is currently text file based), I can update multiple addresses, but as I said, there needs to be a section within the /etc/config/ddns file for each one.

Bill

If your package is suppose to replace ddns-scripts shouldn't it be inside the OpenWRT base repository instead of the package repository?

ddns-scripts just merged into trunk package repository, will take some days until availible as build package
luci-app-ddns update pending

known issues:
still a wrong answer if nslookup something like: >nslookup 123.45.67.89.domain.net
the script returns ip address twice so there never will be a match between registered and local ip
same if you are using bind-host

kpv,
never did a multi-wan setup.
As Bill said, you need a separate config for every single interface.
please try new scripts from trunk when packaged.

Tabis,
a fallback was not planed. If you force IPv6 communication it must work
otherwise set option force_ipversion to "0" then everything will go the easy way