How to make dnsmasq on turris resolve fritz.box

Dear All,

I have an Omnia Turris running as DNS/DHCP server on my home network (with IP 192.168.1.1). WAN connection is provided by an Fritzbox DSL modem on IP 192.168.1.254. Omnia connects through LAN to the Fritzbox. To configure the Fritzbox you usually type “http://fritz.box” inside the browser. This does not work with dnsmasq, I guess due to enforcement of “.lan” search domain. Can you help me making dnsmasq make resolve “fritz.box” to 192.168.1.254 ?

This is my “/etc/config/dhcp”

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option localservice '1'
        option port '0'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option tftp_root '/srv/tftp'
        option enable_tftp '1'
        option dhcp_boot 'lpxelinux.0'
        option expandhosts '1'

config dhcp 'lan'
        option interface 'lan'
        option leasetime '12h'
        option start '110'
        option limit '89'
        option ra_management '1'
        option force '1'
        list dhcp_option '3,192.168.1.254'
        list dhcp_option '6,192.168.1.1'
        list ra_flags 'none'

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 mac 'B4:2E:99:3D:D4:4A'
        option name 'MyPC'
        option dns '1'
        option ip '192.168.1.100'

This is the network setup on my Turris, DNS-Request are forwarded to the Fritzbox:

# cat /etc/config/network

config interface 'loopback'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'
        option device 'lo'

config globals 'globals'
        option ula_prefix 'fdb6:5776:c046::/48'

config interface 'lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option _turris_mode 'unmanaged'
        option ipaddr '192.168.1.1'
        option gateway '192.168.1.254'
        option broadcast '192.168.1.255'
        option device 'br-lan'
        list dns '192.168.1.254'
        list dns_search 'lan'

config interface 'wan'
        option proto 'none'

config device 'br_lan'
        option name 'br-lan'
        option bridge_empty '1'
        list ports 'lan0'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'
        list ports 'eth2'
        option type 'bridge'

config device 'br_guest_turris'
        option bridge_empty '1'
        option type 'bridge'
        option name 'br-guest-turris'

Here are some things that I’ve tried, without success:

  • add “192.168.1.254 fritz.box” to /etc/hosts
  • add a static host entry to /etc/config/dhcp (through turris web gui)
  • add DNS forward “/box/192.168.1.254” to /etc/config/dhcp (through turris web gui)
  • add DNS forward “/fritz.box/192.168.1.254” to /etc/config/dhcp (through turris web gui)

I hope you guys have some more ideas on how to make turris resolve or forward “fritz.box”.

Thank you in advance!

DNS on Turris is not done by dnsmasq, at least not by default.

Setting up in /cgi-bin/luci/admin/network/hosts should work I think (they’ll get suffixed by .lan or whatever other suffix you choose in reForis). But there are some other ways, too: Knot resolver (i.e. kresd) - DNS advanced settings for Omnia and MOX [Turris wiki]

Thank you for that link, this solved my problem!

I enabled the hosts-files by including it into by adding:

list hostname_config '/etc/hosts'

into the

config resolver 'kresd

section

of the

/etc/config/resolver

file. In the hosts-file I added:

192.168.1.1 fritz fritz.box.

Then I restarted the kresd service, now it works.

I don’t know, if the standalone fritz and the finalizing dot at the end are really necessary (probably not), but it works anyway.

Final dot after (each) name don’t make any difference here. (at least if it parses but I believe it would) You defined two names for the address; any count is possible.

By the way, .box top-level domain does exist in official DNS tree. fritz.box currently does not, but that part can at least theoretically change at any arbitrary moment.

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