Use external IP in DHCP Server

Hi. I’m new here.

I have a doubt:

  • When I connect to my network, DHCP give me this address as a DNS server (for example):
    — which is my router IP address.

How can I configure DHCP to “give” me external IP address? Like:
— that’s my ISP main DNS server?

Thanks in advance.

You can't use random public addresses.
It should be either assigned to you by the ISP automatically or explicitly stated in the contract.

Configure a static DHCP lease and a port forwarding:

In LuCI, go to Network -> Interfaces -> LAN -> Edit -> DHCP Server -> Advanced Settings -> DHCP-Options, and enter:
Save & Apply.

If you are using uci, see the DNS and DHCP configuration examples instead.

But why do you want to do this?

OpenWrt receives your ISP's DNS server addresses automatically, along with the IP address for the WAN interface, and forwards DNS queries it cannot answer itself. This will keep working even when your ISP decides to change the DNS server's IP address one day.

1 Like