Prevent OpenWrt from IPv6 name resolution

If I run nslookup google.com GATEWAY, OpenWRT returns me the IPv6, which is useless for me (my ISP doesn't support IPv6) and this prevents some devices to access the internet.
Eg: image

I've already removed all IPv6 from my interfaces and also the ULA-Prefix, but the issue persists.

Is there any solution?

I've never seen the ping4 tool try an IPv6 address...

Can you show this?

image

It returns the IPv4 too (but just sometimes, often when it isn't the first DNS query), but the problem is that my WiFi-connected phones show the exclamation mark and the "No connection" (even if they can surf the web) which is very annoying.....

Sounds like a known issue for musl/getaddrinfo.
It prefers IPv6 addresses even when IPv6 connectivity is missing.
Relevant threads:

1 Like

Unfortunately, I could not solve anything using the methods you proposed...

Collect the diagnostics and post it to pastebin.com redacting the private parts:

ubus call system board; uci show network; uci show firewall; uci show dhcp; \
ip address show; ip route show table all; ip rule show; iptables-save -c; \
head -v -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

https://pastebin.com/kjEwa68q

1 Like

Try this way:

uci -q delete network.loopback.ipv6
uci commit network
/etc/init.d/network restart
1 Like

This behaviour for nslookup is correct. It's returning the routable address first.