DNS resolving problem | opkg not working

Hello together,

my DNS is not working.
I recently changed some settings on my OpenWrt-Wireguard-Server. (just connecting some wireguard peers.)

  • no lan interface, just a wan interface
    (I know I probably do not need the bridge, I just kept it )

When I changed my lan to wan interface with dhcp client, DNS is not working any more. I just need it for the opkg update. I ping outside the router works fine.

> 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 'fd14:c55f:f576::/48'
> 
> config device
>         option name 'br-lan'
>         option type 'bridge'
>         list ports 'eth0'
> 
> config interface 'wg0'
>         option proto 'wireguard'
>         option listen_port '51820'
> ….
> config interface 'wan'
>         option device 'br-lan'
>         option proto 'dhcp'
> 

here is the dhcp config:

> config dnsmasq
>         option domainneeded '1'
>         option boguspriv '1'
>         option filterwin2k '0'
>         option localise_queries '1'
>         option rebind_protection '1'
>         option rebind_localhost '1'
>         option local '/lan/'
>         option domain 'lan'
>         option expandhosts '1'
>         option nonegcache '0'
>         option authoritative '1'
>         option readethers '1'
>         option leasefile '/tmp/dhcp.leases'
>         option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
>         option nonwildcard '1'
>         option localservice '1'
>         option ednspacket_max '1232'
> 
> config dhcp 'wan'
>         option interface 'wan'
>         option ignore '1'
>         option start '100'
>         option limit '5'
>         option leasetime '2m'
>         list ra_flags 'none'
> 
> config odhcpd 'odhcpd'
>         option maindhcp '0'
>         option leasefile '/tmp/hosts/odhcpd'
>         option leasetrigger '/usr/sbin/odhcpd-update'
>         option loglevel '4'

thanks

If you want to investigate the problem, you need to post the result of the following commands:

head -n -0 -v /etc/resolv* /tmp/resolv* /tmp/resolv*/*

Otherwise two workarounds should be possible:

uci set network.wan.peerdns="0"
uci add_list network.wan.dns="8.8.8.8"
uci add_list network.wan.dns="8.8.4.4"
uci commit network
/etc/init.d/network restart

or

uci add_list dhcp.@dnsmasq[0].server="8.8.8.8"
uci add_list dhcp.@dnsmasq[0].server="8.8.4.4"
uci commit dhcp
/etc/init.d/dnsmasq restart

Thanks,

I compared my resolve files with a different router
-> i can't see the problem.


>  ...
> root@vm-wrt:~# head -n -0 -v /etc/resolv* /tmp/resolv* /tmp/resolv*/*
> ==> /etc/resolv.conf <==
> search wan
> nameserver 127.0.0.1
> nameserver ::1
> 
> ==> /tmp/resolv.conf <==
> search wan
> 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 10.5.1.1
> search lan
> ...

I followed your first step, that works fine. Thanks :wink:

The command edit my network config:

option peerdns '0'
list dns '8.8.8.8'
list dns '8.8.4.4'

But why do i need to specify a dns address?

Most likely the DNS server assigned via DHCP by the upstream device does not resolve for some reason or is unreachable. You can easily check it.

nslookup downloads.openwrt.org 10.5.1.1
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.