Here's my current network configuration:
Vodafone Station modem
│
└─ OpenWrt router via LAN
│
├─ smartphone
├─ TV
│
└─ TP-Link router via Powerline (other room)
│
├─ laptop #1
└─ laptop #2
The OpenWrt router is connected to the Vodafone Station via a regular LAN cable, and the TP-Link router is connected to the OpenWrt router via Powerline.
Due to issues with the powerline speed from OpenWrt I want to connect the TP-Link router directly to the Vodafone Station (via Powerline too):
Vodafone Station modem
│
├─ OpenWrt router via LAN
│ │
│ ├─ smartphone
│ └─ TV
│
├─ TP-Link router via Powerline (other room)
│ │
│ └─ laptop #1
│
└─ laptop #2
How do I configure OpenWrt as the DNS
- on the TP-Link router and
- on laptop #2 (Ubuntu)?
I have already configured the Vodafone Station to give the OpenWrt router the static DHCP address 192.168.0.251
, but when simply entering that IP address into laptop #2's DNS server text field, no Internet domains are resolved anymore.
Unfortunately, the Vodafone Station does not have a DNS setting itself, and modifying its firmware is not an option as the device is owned by Vodafone.
On the OpenWrt router I've installed the Adblock package which uses dnsmasq as its back-end. dnsmasq forwards local inbound DNS requests from port 53 to port 5453 at which Stubby listens. (I use Stubby for DoT and DNSSEC.)
To configure dnsmasq and Stubby, I strictly followed this tutorial by German IT expert Mike Kuketz.
Here are the commands I used:
uci add_list dhcp.@dnsmasq[-1].server='127.0.0.1#5453'
uci set dhcp.@dnsmasq[-1].noresolv=1
uci commit && reload_config
uci set network.wan.peerdns='0'
uci set network.wan.dns='127.0.0.1'
uci set network.wan6.peerdns='0'
uci set network.wan6.dns='0::1'
uci commit && reload_config
uci set dhcp.@dnsmasq[-1].dnssec=1
uci set dhcp.@dnsmasq[-1].dnsseccheckunsigned=1
uci commit && reload_config
OpenWrt's firewall blocks access to port 53 via UDP and TCP to prevent devices from circumventing OpenWrt's DNS.