Dual DNS/DHCP for LAN/GUEST not working

Hi everyone !
I have a Linksys WRT3200ACM for which I'm quite happy (except maybe the wifi range...) and after selling my Netgear WNDR38000 that served that as a Guest AP, I decided to add this functionality to my WRT3200.
I followed this 2 guides:

Everything works quite well except for the LAN DNS: when I try to resolve for example my router (that's it's name), instead of "router.hysteresis.lan" (which is my LAN domain), I get "router.guest.lan", which is, of course, the GUEST domain.
I tried many configurations but I believe that the problems is with the DNS server: after restarting many time the DNS server (/etc/init.d/dnsmasq restart), it appears that sometimes, it resolves the right name (router.hysteresis.lan), and after a restart, it give the wrong name, in a randomly way. And it drives me crazy :crazy_face:
Here are my configurations files:

root@router:/etc/config# cat network
config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd72:14a8:6d9d::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.51.254'
	option broadcast '192.168.51.255'
	option _orig_ifname 'eth0.1 radio1.network1 radio2.network1'
	option _orig_bridge 'true'
	option ifname 'eth0.1'
	option delegate '0'
	option dns '127.0.0.1'

config interface 'guest'
	option proto 'static'
	option netmask '255.255.255.0'
	option broadcast '192.168.100.255'
	option delegate '0'
	option ipaddr '192.168.100.254'
	option dns '127.0.0.1'

config interface 'wan'
	option ifname 'eth1.2'
	option proto 'dhcp'
	option delegate '0'
	option peerdns '0'
	option dns '127.0.0.1'

config interface 'wan6'
	option ifname 'eth1.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 3 5t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'
root@router:/etc/config# cat wireless 

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11a'
	option channel '120'
	option htmode 'VHT160'
	option country 'FR'
	option path 'soc/soc:pcie/pci0000:00/0000:00:01.0/0000:01:00.0'
	option legacy_rates '1'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'WHATEVER'
	option macfilter 'allow'
	option encryption 'psk2+ccmp'
	option key 'WHATEVER'
	option wpa_disable_eapol_key_retries '1'
	list maclist 'WHATEVER1'
	list maclist 'WHATEVER'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11g'
	option channel '3'
	option htmode 'HT40'
	option country 'FR'
	option noscan '1'
	option ar '1'
	option bursting '1'
	option ff '1'
	option path 'soc/soc:pcie/pci0000:00/0000:00:02.0/0000:02:00.0'
	option legacy_rates '1'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'WHATEVER'
	option encryption 'psk2+ccmp'
	option key 'WHATEVER'
	option wpa_disable_eapol_key_retries '1'
	option macfilter 'allow'
	list maclist 'WHATEVER'
	list maclist 'WHATEVER'

config wifi-iface 'guest'
	option device 'radio1'
	option mode 'ap'
	option ssid 'WHATEVER'
	option isolate '1'
	option key 'WHATEVER'
	option encryption 'psk2+ccmp'
	option wpa_disable_eapol_key_retries '1'
	option network 'guest'

config wifi-device 'radio2'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'platform/soc/soc:internal-regs/f10d8000.sdhci/mmc_host/mmc0/mmc0:0001/mmc0:0001:1'
	option htmode 'VHT80'
	option disabled '1'

config wifi-iface 'default_radio2'
	option device 'radio2'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'
	option network 'lan'
root@router:/etc/config# cat dhcp

config dnsmasq 'lan_dns'
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option expandhosts '1'
	option authoritative '1'
	option leasefile '/tmp//dhcp_lan.leases'
	option localservice '1'
	option logqueries '1'
	option logfacility '/mnt/usb/log/dnsmasq_lan.log'
	option local '/hysteresis.lan/'
	option domain 'hysteresis.lan'
	option allservers '1'
	option nohosts '1'
	option filterwin2k '1'
	option nonegcache '1'
	option noresolv '1'
	list server '127.0.0.1#5353'
	option enable_tftp '1'
	option tftp_root '/mnt/usb/pxe/'
	option nonwildcard '1'
	list interface 'lan'
	option resolvfile '/tmp/resolv_lan.conf'

config dhcp 'lan'
	option interface 'lan'
	option force '1'
	option dynamicdhcp '0'
	list dhcp_option '42,192.168.51.254'
	option start '100'
	option limit '150'
	option leasetime '24h'
	option instance 'lan_dns'

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 host
	option name 'WHATEVER'
	option mac 'WHATEVER'
	option ip '192.168.51.152'

config host
	option name 'WHATEVER'
	option mac 'WHATEVER'
	option ip '192.168.51.153'

config host
	option name 'WHATEVER'
	option mac 'WHATEVER'
	option ip '192.168.51.153'

config dnsmasq 'guest_dns'
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option expandhosts '1'
	option authoritative '1'
	option leasefile '/tmp/dhcp_guest.leases'
	option localservice '1'
	option logqueries '1'
	option logfacility '/mnt/usb/log/dnsmasq_guest.log'
	option local '/guest.lan/'
	option domain 'guest.lan'
	option allservers '1'
	option nohosts '1'
	option filterwin2k '1'
	option nonegcache '1'
	option noresolv '1'
	list server '9.9.9.9'
	list server '149.112.112.112'
	list server '80.67.169.12'
	list server '80.67.169.40'
	list server '1.1.1.1'
	list server '1.0.0.1'
	option nonwildcard '1'
	list interface 'guest'
	list notinterface 'loopback'
	option resolvfile '/tmp/resolv_guest.conf'

config dhcp 'guest'
	option interface 'guest'
	option force '1'
	option limit '200'
	option leasetime '12h'
	option start '10'
	option instance 'guest_dns'

I have to add that I use dnscrypt-proxy2 for my DNS resolution, that's why there is a

list server '127.0.0.1#5353'

in my "lan_dns". And it's not mandatory for the guests to use it.

So, if anyone has an explnation to my problem, I would be infinitely grateful to him for that ! :slight_smile:

Thank you !

Where have you specified the binding of IP and name? Hosts would be a good place, but it is disabled. Or a host entry in dhcp config file.

There are already "hosts" definitions in my DHCP configuration :slight_smile:

config host
	option name 'WHATEVER'
	option mac 'WHATEVER'
	option ip '192.168.51.152'

config host
	option name 'WHATEVER'
	option mac 'WHATEVER'
	option ip '192.168.51.153'

Anyway, I finally managed to get through this, by removing the line

interface br-lan

in my /etc/dnsmasq.conf
I don't know what's their relationship but now, everything works fine !
Thanks

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