How do you update the dns server with openwrt?

Playing around with the OpenWrt One i got, trying to set it up.

I can ssh inside and access internet:

root@OpenWrt:~# ping -c 4 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=115 time=10.234 ms
64 bytes from 8.8.8.8: seq=1 ttl=115 time=11.998 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 10.234/11.116/11.998 ms

However i cannot do :

root@OpenWrt:~# ping -c 4 google.com
PING google.com (2a00:1450:4007:80d::200e): 56 data bytes

--- google.com ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

Which means i cannot update or install packages either:

root@OpenWrt:~# ping -c 4 google.com
PING google.com (2a00:1450:4007:80d::200e): 56 data bytes

--- google.com ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss
root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/24.10.0-rc2/targets/mediatek/filogic/packages/Packages.gz
SSL error: NET - Sending information through the socket failed
*** Failed to download the package list from https://downloads.openwrt.org/releases/24.10.0-rc2/targets/mediatek/filogic/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/24.10.0-rc2/packages/aarch64_cortex-a53/base/Packages.gz
SSL error: NET - Sending information through the socket failed
*** Failed to download the package list from https://downloads.openwrt.org/releases/24.10.0-rc2/packages/aarch64_cortex-a53/base/Packages.gz

Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/24.10.0-rc2/targets/mediatek/filogic/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/24.10.0-rc2/packages/aarch64_cortex-a53/base/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.
root@OpenWrt:~# cat /etc/resolv.conf
search lan
nameserver 127.0.0.1
nameserver ::1

Im assuming the dns server isnt set to 8.8.8.8, does anyone know whats missing in the setup?

Correct, it's your ISP's by default (issued by DHCP). Hence why your resolution worked:

This is the problem. Did you make a custom image?

(BTW, you can use a custom DNS by disabling you ISP's and editing the WAN DNS.)

Note that 8.8.8.8 is one of Google's IPv4 addresses, while 2a00:1450:4007:80d::200e is an IPv6 address. The ping fails because your IPv6 wan connection is broken. Either fix that or remove / disable wan6 so the kernel does not expect to have a working IPv6 connection.

DNS is actually working. Most major websites (google, openwrt, etc) have both v4 and v6 addresses which will be returned by any DNS server. If the application (ping, wget, etc.) thinks that v6 is available, it will prefer to use it.

3 Likes

Hello thanks for the answer, i just used the preinsstalled image, on 24.10.0:

root@OpenWrt:~# cat /etc/rele^C

root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='24.10.0-rc2'
DISTRIB_REVISION='r28161-ea17e958b9'
DISTRIB_TARGET='mediatek/filogic'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt 24.10.0-rc2 r28161-ea17e958b9'
DISTRIB_TAINTS='no-all'

Someone mentioned to delete wan6 ipv6 interface and it seemed to work

1 Like