OpenWrt and Pihole for host names


Firmware used : 18.06.1

I have setup pihole ( Rapsberry pi ) with OpenWRT Router ( LinkSys WRT1900ACS ). DHCP runs in router. Everything works fine except IP address are shown ( instead of hostnames ) in Pihole Logs. I am aware of the two methods to show hostnames

  1. Run DHCP in Pihole : ( Plan to use it as a last option )
  2. Use Static IPs in the router and update /etc/hosts in pihole. ( Want to avoid this because of the additional burden of maintaining both files ).

I understand there is a third way which is related to 'DNS forwarding' in the router. Can anyone help with this for OpenWRT?

Sounds like you need the Pi Hole to have the knowledge about reverse DNS for your locally managed IP addresses, so it would likely be properly configuring the resolver on the Pi, not on OpenWrt. If you configure the Pi Hole to use OpenWrt for its upstream DNS, then you will likely be able to reverse-resolve the DHCP-leased IP addresses.


Thanks. Looks like I have to disable these Advanced DNS settings in pihole.

“Never forward non-FQDNs”
“Never forward reverse lookups for private IP ranges”.

Will try and check. Thanks for the help.

1 Like

It seems to be working. I see hostnames for most of the clients now. Thanks!.



This is the configuration

Log into LEDE and choose Network > Interfaces


Select the LAN interface and choose EDIT


Under Interfaces>General Setup I have set the custom DNS server to that of the pi-hole as well. Hit save.


Scroll down to the DHCP server and go to advanced settings. Under DHCP-Options add the line '6,' where xxx is the address of your pi-hole. Save and Apply. Give it a few minutes for everything to flush and get assigned appropriately. This should allow you to use LEDE with pihole correctly.




My Topic


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