Ddns error while using AGH

Hi,

I setup my BT3200 with a SNAPSHOT of 23.05. and configured DDNS. So far so good.

After that, installed AGH and configured as described in the wiki. Beside the following error. I don't know if that is connected to the AGH problem below.

root@OpenWrt:~# nft add rule nat pre udp dport 53 ip saddr 192.168.1.0/24 dnat 1
92.168.1.1:53
Error: Could not process rule: No such file or directory
add rule nat pre udp dport 53 ip saddr 192.168.1.0/24 dnat 192.168.1.1:53
         ^^^

When trying to update DDNS, the following error shows

131349       : Detect registered/public IP
 131349       : #> /usr/bin/nslookup dyndns.xyz.com  >/var/run/ddns/dyndns_xyz_com_ipv4.dat 2>/var/run/ddns//dyndns_xyz_com_ipv4.err
 131349 ERROR : BusyBox nslookup error: '1'
 131349       : nslookup: write to '127.0.0.1': Connection refused
nslookup: write to '::1': Connection refused

If I configure DNS-Server=1.1.1.1 within LUCI for DDNS, the following error occurs

132926       : #> timeout 2 -- /usr/bin/nc 8.8.8.8 53 </dev/null >/var/run/ddns/dyndns_xyz_com_ipv4.dat 2>/var/run/ddns/dyndns_xyz_com_ipv4.err
 132926       : Detect registered/public IP
 132926       : #> /usr/bin/nslookup dyndns.xyz.com 8.8.8.8 >/var/run/ddns/dyndns_xyz_com_ipv4.dat 2>/var/run/ddns/dyndns_xyz_com_ipv4.err
 132926       : Registered IP '91.xxx.xxx.65' detected
 132926  info : Starting main loop at 2023-09-08 13:29
 132926       : Detect current IP on 'network'
 132926       : Current IP '149.xxx.xxx.140' detected on network 'wan'
 132926       : Update needed - L: '149.xxx.xxx.140' <> R: '91.xxx.xxx.65'
 132926       : #> /bin/uclient-fetch -q -O /var/run/ddns/dyndns_xyz_com_ipv4.dat -Y off 'https://api.org-dns.com/dyndns/?user=***&key=***&domain=dyndns.xyz.com' 2>/var/run/ddns/dyndns_xyz_com_ipv4.err
 132931 ERROR : uclient-fetch Error: '4'
 132931       : Failed to send request: Operation not permitted
 132931  WARN : Transfer failed - retry 1/0 in 60 seconds

So somehow AGH messes up the DNS communication. However, as I'm not an expert, any hints on what I can do?

Thanks a lot in advance.

Maybe this can help?

1 Like

Thanks. I'm not sure how that should work, e.g. switch to curl. However, I also noticed the following:

root@OpenWrt:/etc/config# ping google.com
ping: bad address 'google.com'
root@OpenWrt:/etc/config# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=60 time=13.024 ms

So somehow the URL is not resolved. Is that caused by AGH? If yes, how can I solve that issue? This is driving me nuts for many hours now. :frowning:

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; \
uci export dhcp; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

Sure. Thanks for the support.


root@OpenWrt:/etc/config# ubus call system board
{
        "kernel": "5.15.120",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 4",
        "model": "Linksys E8450 (UBI)",
        "board_name": "linksys,e8450-ubi",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r23597-f0445746f6",
                "target": "mediatek/mt7622",
                "description": "OpenWrt SNAPSHOT r23597-f0445746f6"
        }
}
root@OpenWrt:/etc/config# uci export network
package network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd76:xxxx:xxxx::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config interface 'guest'
        option proto 'static'
        list ipaddr '192.168.3.1/24'

config interface 'vpn'
        option proto 'wireguard'
        option private_key 'xxx'
        option listen_port '51820'
        list addresses '192.168.8.1/24'
        list addresses 'fd00:8::1/64'

config wireguard_vpn 'wgclient1'
        option description 'xxx'
        option public_key 'xxx'
        option preshared_key 'xxx'
        list allowed_ips '192.168.8.210/32'
        list allowed_ips 'fd00:8::210/128'

root@OpenWrt:/etc/config# uci export dhcp
package dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '0'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'
        option confdir '/tmp/dnsmasq.d'
        option noresolv '0'
        option port '54'
        list server '192.168.1.1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        list dhcp_option '6,192.168.1.1'
        list dhcp_option '3,192.168.1.1'
        list dns '2a02:8071:5aa3:7d20::1'
        list dns 'fd76:dd32:59d7::1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config dhcp 'guest'
        option interface 'guest'
        option start '100'
        option limit '150'
        option leasetime '1h'

root@OpenWrt:/etc/config# ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; h
ead -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
lrwxrwxrwx    1 root     root            16 Jul 21 20:28 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            47 Sep  7 19:08 /tmp/resolv.conf
-rw-r--r--    1 root     root           134 Sep  8 15:40 /tmp/resolv.conf.d/resolv.conf.auto

/tmp/resolv.conf.d:
-rw-r--r--    1 root     root           134 Sep  8 15:40 resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf.d <==
head: /tmp/resolv.conf.d: I/O error

==> /tmp/resolv.conf.d/resolv.conf.auto <==
# Interface wan
nameserver 81.210.129.4
nameserver 80.69.96.12
# Interface wan6
nameserver 2a02:908:2:b::1
nameserver 2a02:908:2:a::1

EDIT
Also opkg ended up with errors. But if I remember correctly, this is that cause by me using "outdated" SNAPSHOTS

Failed to send request: Operation not permitted
Failed to send request: Operation not permitted
Failed to send request: Operation not permitted
Failed to send request: Operation not permitted
Failed to send request: Operation not permitted
Failed to send request: Operation not permitted
Failed to send request: Operation not permitted
Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

So I found out if I replace the Custom Update URL for DDNS

(https://api.org-dns.com/dyndns/?user=***&key=***&domain=dyndns.xyz.com)

=>

(https://84.19.1.227/dyndns/?user=***&key=***&domain=dyndns.xyz.com)

it results in

 173014 ERROR : uclient-fetch Error: '1'
 173014       : Failed to allocate uclient context

However, the IP is updated. But that is probably not the solution :wink:

Ok, it is definitely caused by AGH. After reverting the config, everything works fine again. Any idea what I need to configure with AGH being active?

It seems like misconfigured AGH, as after it is installed it is handling all the DNS queries, so if you cannot query google.com then something is really wrong with it.

Ok, as I configured it according to the wiki, I'll move this question to the AGH thread.

1 Like