Static DNS / IP correlation GUI under tools


I would like to humbly request an addition to the GUI to include a static DNS/IP mapping to be resolved by the pihole software.

At the moment this can easily be accomplished via the cmd line by editing the /etc/hosts or even /etc/dnsmasq.d/05-custom.conf

I would imagine more than just myself would benefit from this.


reddit link

I agree.

I'd also suggest a URL shortener to create short links akin to or something like that.

pi/foo for example that could point to some long URL. pi would take you to the interface that let's you create those links.

It would help us with deciding how to implement these requests if you could also explain a little how it would help us block ads more effectively, or what benefit it would bring to the users. Some features go a bit beyond the scope of ad-blocking and are better served by other utilities and software packages, so knowing what the end goal is can be really helpful to us.

I will fully reply shortly . Thank you.

The URL shortener is certainly a stretch when it comes to the primary goal of ad blocking. That totally makes sense and I consider that a "nice to have" and a neat feature.

The static DNS entries are a bit more fuzzy. To block ads most people are using the pi.hole as a replacement DNS server for their network. I'd put forth that since the pi.hole is used as a replacement DNS server, being a good DNS server is part of the core purpose of the project. Not the entire or primary purpose, but part of the method used to achieve that purpose.

Having the ability to set static DNS entries to hosts in an internal network would allow me to use the pi.hole as the source of truth for DNS on my network. That makes it a complete solution in regards to DNS entries and resolution and makes it a better all around solution. That means I don't have to run separate infrastructure to supply those static and local entries. I hope that makes sense.

1 Like

Thanks for the comments, we'll look in to the best way to edit the hosts files securely via the web interface. I think there's been some talk about the feature and it's something that is under consideration for a future release.


I could not have said it better myself. PiHole has taken over as my primary DNS server in my home and home lab, so it would be nice to be able to update static entries via the web gui. I realize if I used it for DHCP this would not be an issue but that service is handled elsewhere on the edge router.

Thanks Dan!

Does this fill the need?

yes, but not from the GUI which is my feature request. If this is currently in the master branch, then I/we can use it now :smiley: Thanks!!

I would like this as well. I use my router as a DHCP server (already had it set up and have dozens of static DHCP and DNS assignments), and have it's primary DNS point to PiHole, which then resolves/blocks the request, and forwards it to Google's DNS.
However, doing so causes issues.

  1. All Hosts that the PiHole sees are from the router's hostname, unless I manually set that computer's DNS server to be the PiHole, which causes issue number 2.
  2. If I set a computer's DNS server to the PiHole, all entries I set in the router are ignored, and go unresolved. I have many internal DNS records for multiple devices.
    I'm comfortable with the hosts file, but would rather not go there if I didn't have to each time I make a change (quite often.)

I would like to see this feature added too. I can kind of work around it by adding the device details to the DHCP leases section under Pihole settings but that's not really a good solution IMO.

+1 for this request !

Static entries in GUI would definitely cover many needs, especially when dealing with LAN dns entries.

Ditto here. PiHole has become my internal DNS server responding to queries for my local LAN and forwarding all other queries to my Internet Gateway Router which in turn uses CloudFlare.

Having a tool in the GUI to manage hosts on the local LAN would make life much easier.

It's true, this doesn't necessarily enhance the primary functionality of PiHole in ad-blocking. But as was previously stated, PiHole is also performing the role as a local DNS resolver, so why not use it for lookups of local hostnames as well.

Thanks in advance...

Another reason why this feature could be VERY useful and would need to add the ability to maintain external static mapping in addition to internal DNS mapping is for network wide development and testing as well as a great tool for testing Certificate pinning for SSL/TLS. All developers know how to use host files on their computers to do this type of testing but being able to have a network resolver reply with static entries for a given external host would be about the most valuable tool for testing and development without having to use "" for all of your external testing and then hope "" works when you hot-cut over to a live environment.

Testing certificate pinning for apps on mobile is virtually impossible on an iphone unless you run your own BIND server and add the entire zone to it for testing.

The suggest solution from Mcat12 (Add host-record option) unfortunately doesn't really solve the issue around static DNS entries as the "host-record" option only allows for 1 entry.

Beta v5.

1 Like

Thank you Dan. Cannot wait to try!

3 posts were split to a new topic: Beta 5.0 notes and questions