Rewriting outbound URLs

Dear all

When we got 900 mbps FTTP a couple of years ago, I installed OpenWrt SNAPSHOT r15599-37752336bd / LuCI Master git-21.020.56896-af422b1 on a Raspberry Pi 4 Model B Rev 1.4 as my main router. It has been working excellently ever since.

One reason for choosing OpenWrt was because I hoped it might be able to be configured to do some other special stuff and I've finally got round to thinking about it.

I have a number of devices on the lan which are pre-programmed to send data to specific url's on the wan, an example is a weather station sending data as GET requests to a restful endpoint at

What I would like to do is rewrite "" to "" where myserver is also on the wan and running an instance of node-red in which I can create a matching endpoint and parse the data into my own database (and then forward the whole thing onwards to

Can this rewrite be done as it passes through openWrt ? how?

Thanks for your help.


If this does not involve HTTPS, then you can simply rebind the domain like this:


You can change the ip address of in DNSMasq so that it points e.g. to your router or a server on your lan.

You can add this as in /etc/config/dhcp so that points to
list address '/'

1 Like

I have already set weather device to a static local IP

so according yo your link (ip v4 only) the script would be?

uci add dhcp domain
uci set dhcp.@domain[-1].name=""   // url we want to intercept
uci set dhcp.@domain[-1].ip=""  // IP of
uci commit dhcp
/etc/init.d/dnsmasq restart

(assume // is comment, but doesn't matter)

Presumably this is a script I run by SSHing into my router as root ?

or is there a way of doing it in the LuCI UI ?




Carefully reading the linked section gives you: