Wlan cannot solve domain names

Hello,

Sorry if this is a newbie question.

My system has ethernet and wifi interfaces. Lan connection has metric 100, Wlan is 200 and is static configured.
When a eth cable without internet connects before Wlan, Wlan cannot solve domain names.
Example: With Wlan I can only ping 8.8.8.8, but not google.com.
Is there any option to work this around and ping directly a domain?

My config file:

# /etc/config/network
config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0'
    option proto 'dhcp'
    option macaddr '1c:88:79:55:51:9f'
    option dns '8.8.8.8'
    option peerdns '1'
    option metric '100'


config interface 'aplan'
    option proto 'static'
    option ipaddr '192.168.69.1'
    option netmask '255.255.255.0'
    option ipv6 '0'
    option disabled '0'

config interface 'wlan'
    option proto 'static'
    option ipaddr '192.168.178.10'
    option netmask '255.255.255.0'
    option metric '200'
    option disabled '1'
    option dns '8.8.8.8'
    option peerdns '1'
    option metric '200'

Any help at all would be greatly appreciated,

Ian

Sounds like this issue from earlier today.

Thanks for your reply.

I tried addind the dhcp_option for wlan in DHCP config, but it didn't worked:

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.auto'

config dhcp 'lan'
        option interface 'lan'
        option ignore '1'
        option dhcpv6 'server'
        option ra 'server'
        list dhcp_option '6,8.8.8.8'

config dhcp 'wan'
        option interface 'wlan'
        option ignore '0'
        option ra 'disabled'
        option dhcp_option '6,8.8.8.8'
        option dhcpv4 'disabled'
        option dhcpv6 'disabled'


config dhcp 'aplan'
        option start '2'
        option limit '10'
        option leasetime '12h'
        option interface 'aplan'

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

When WLAN is on default route, it resolves DNS. But I would like it to resolve DNS when its not on default route, when the default route has no internet connection.
route -n:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.178.1   0.0.0.0         UG    100    0        0 eth0 <-- has no internet connection
0.0.0.0         192.168.178.1   0.0.0.0         UG    200    0        0 wlan0
192.168.178.0   0.0.0.0         255.255.255.0   U     100    0        0 eth0
192.168.178.0   0.0.0.0         255.255.255.0   U     200    0        0 wlan0

Best regards,

did you restart the dnsmasq afterwards ?

what DNS IPs are provided by DHCP to the clients ?

Yes, I rebooted the gateway to avoid cached DNS.

cat /tmp/resolv.conf.auto

# Interface lan
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 192.168.178.1
search fritz.box
# Interface wlan
nameserver 8.8.8.8
nameserver 8.8.4.4

Those are the same that I defined in the network config file.

that wouldn't be on the actual client(s), would it ?

My gateway has no clients.

If it doesn't have internet connection and has lower metric, then your traffic will be blackholed.
You need mwan3 package to manage multiple connections and monitor them if they have connection to the internet or not.

1 Like

Thank you, I was hoping there was a solution in a config file.
I will test MWAN3.

1 Like