DHCP/DNS config as client but with hosts mapping

Is it possible to configure an OpenWrt access point as a DHCP client of my main router but still be able to share hostnames mapping to the AP clients?

My simplified network looks like this:

Main Router ---- PC
|            |
|            |--))) Server
WiFi AP ---))) Printer
         |--))) Smartphone


--- LAN
--))) Wireless

The problem is that my main router doesn't let for loopbacks. My server is visible outside the network as example.com and when I'm trying to reach it from within my LAN then example.com is unreachable.

What I want to achieve is:

  1. The PC sees the printer
  2. The smartphone when connected to the AP sees the Server using example.com

I have just installed OpenWRT on the AP but failed with DHCP configuration and left it just as a dummy DHCP client for the main router so now every guy see other guys but only using LAN addresses.

Please help me set it up :slight_smile:

@rychu, welcome to the community!

Just make your DNS and DHCP server the same device.

I'm guessing that is the main router. If you setup the OpenWrt as an AP properly, that should work.

1 Like

Ah, I forgot to mention that my main router is delivered to me by my ISP and is very poor in features. It doesn't have a possibility of hosts mapping sharing. I can only forward ports on it and enable/disable DHCP. That's it...

So disable DHCP on the main router and use OpenWrt's.


Thanks @lleachii, that worked!

In case someone seeks any details. I have a UPC Horizon box which appeared to be working with disabled DHCP only when having static IP address. Any other IP or even assigning it a hostname in its settings makes it undiscoverable by other devices.

So I assigned the main router the static IP and disabled DHCP on it. Then went into AP's OpenWRT settings. Also assigned a static IP to it. Enabled DHCP. Gateway set to the main router's IP.
Then I logged to the AP through SSH and added hosts mapping to the hosts file in \etc\ folder.

Thanks to this setup all devices connected to the main router and to the AP with OpenWRT can communicate with each other and my server is reachable to all devices within the local network by example.com.

Thanks once more!

1 Like

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