Resolve WAN as LAN on Turris

From One-Eyed Man Wiki
Jump to navigation Jump to search

Making hairpin/loopback/reflection requests on public URLs is not complicated but the information is well hidden from Turris users. (None of this is accessible from the Luci GUI.)

In /etc/config/resolver, you need this stanza:

config resolver 'kresd'
     option rundir '/tmp/kresd'
     option log_stderr '1'
     option log_stdout '1'
     option keep_cache '1'
     option include_config '/etc/kresd/custom.conf'

Create the /etc/kresd/custom.conf file.

Fill up custom.conf with "hints":

hints['mon.sous.domaine.fr'] = '192.0.2.118'

In my own case, the file is:

hints['oneeyedman.net'] = '192.168.2.2'

hints['www.oneeyedman.net'] = '192.168.2.2'

hints['state-sponsored-actors.org'] = '192.168.2.2'

hints['www.state-sponsored-actors.org'] = '192.168.2.2'

hints['payments.brechtsociety.org'] = '192.168.2.2'

hints['txl.oneeyedman.net'] = 'berlin3.chickenkiller.com'

hints['ads-b.oneeyedman.net'] = '192.168.4.4'

Restart the kresd daemon.

Sources:

Sort of useful -- https://wiki.turris.cz/doc/en/public/dns_knot_misc

Totally useless -- https://knot-resolver.readthedocs.io/en/stable/modules-hints.html

Other confused people -- https://forum.turris.cz/t/configure-kresd-to-resolve-a-wan-address-to-a-lan-ip/13597/15