New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom DNS entrees #975

Closed
paulkramme opened this Issue Dec 9, 2016 · 26 comments

Comments

Projects
None yet
@paulkramme
Copy link

paulkramme commented Dec 9, 2016

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

How familiar are you with the codebase?:

  • [] 1 (very unfamiliar)
  • 2
  • [] 3
  • [] 4
  • [] 5
  • [] 6
  • [] 7
  • [] 8
  • [] 9
  • [] 10 (very familiar)

FEATURE REQUEST:
I'd like to add easy DNS entrees, so i can reach my local devices over them. Since hostnames are not working after switching DNS from router to pihole, this would be nice. I'm very sorry if i reposted this, i did not find it under open issues.

This template was created based on the work of udemy-dl.

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented Dec 9, 2016

Are you asking to use a custom upstream provider for your DNS server (in place of Google or OpenDNS for example) or are you asking about entering data into the Pi-hole's HOSTS file so that you can reach local machines by their short names?

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Dec 9, 2016

Latter.

@Mcat12

This comment has been minimized.

Copy link
Member

Mcat12 commented Dec 9, 2016

Add your hosts to your Pi-hole's /etc/hosts file.

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented Dec 9, 2016

Okay, I will pass that along as a feature request, it's possible to do now, if you use the Pi-hole's dnsmasq process as your DHCP server, but we need to work out a way to safely edit the /etc/hosts file and determine a process to present those options to the users. If the Pi-hole also acts as the DHCP server, then dnsmasq will automatically add the short name to the resolver's lookups but this would require disabling the DHCP server on the router and passing that function over to the Pi. It's a feature we are talking about, but we want to do it in a sane way that will hopefully avert the possibility of a user locking themselves out, :) If you'd like to open a Feature Request over on discourse then other users will be able to vote and comment on the idea.

@jannylund

This comment has been minimized.

Copy link

jannylund commented Jan 18, 2017

@paulkramme an easy workaround for this is to set pihole to use your routers dns instead of google, then your local host config works as before.

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Jan 18, 2017

@woftor

This comment has been minimized.

Copy link

woftor commented Jan 30, 2017

Edit the file /etc/dnsmasq.d/03-pihole-wildcard.conf

Add entries like this:

address=/printer.mydomain.com/192.168.2.9
address=/babycam.mydomain.com/192.168.2.10

This is working very well here. Don't forget to flush DNS on Windows machine when testing.
You cannot enter these values in the webinterface, there only default values are possible (it's the wildcard option). Maybe it could be added to the webinterface.

@ldrrp

This comment has been minimized.

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Feb 16, 2017

@ldrrp Wow! Thats great, hopefully it will boost this feature.

@jacobsalmela jacobsalmela added the Bounty label Feb 16, 2017

@woftor

This comment has been minimized.

Copy link

woftor commented Feb 20, 2017

You can also make a new file in /etc/dnsmasq.d/ with .conf extentsion. All files in this directory are read by dnsmasq. You can add/map DNS entries just like I said in my previous post like this:

address=/printer.lan/192.168.2.9
address=/babycam.lan/192.168.2.10

Again: it would be very nice if this was a feature of the web-gui.

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Feb 20, 2017

I think i will write a program for this, i will link this here when im finished. Can i name the file whatever i want, like mom.conf?

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented Feb 20, 2017

Conf files are sourced lexicographically, so 01 first, but typically they are named with a number leading, so 99 would be sourced last, so a 50-mom.conf would be in the middle and can still be overridden. (dnsmasq will throw errors if commands are duplicated, but should be okay if they are appending.)

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Feb 20, 2017

@DL6ER

This comment has been minimized.

Copy link
Member

DL6ER commented Feb 20, 2017

Unfortunately, I don't have much time this week, but I will look into this issue. I don't need this as I'm using the Pi-hole DHCP server, which already adds this functionality.

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Feb 20, 2017

I created a repository

@ldrrp

This comment has been minimized.

Copy link

ldrrp commented Feb 20, 2017

@paulkramme its probably better to add it to the web interface since it is protected by a login.

@paulkramme

This comment has been minimized.

Copy link

paulkramme commented Feb 20, 2017

@DL6ER DL6ER self-assigned this Mar 3, 2017

@tobiastom

This comment has been minimized.

Copy link

tobiastom commented May 22, 2017

Just as a small addition, this might also be a nice feature to configure specific addresses to a given localised IP, this would solve some problems with geo location based IPs.

@Mcat12

This comment has been minimized.

Copy link
Member

Mcat12 commented May 22, 2017

It looks like this feature has been implemented: #1266

@tobiastom

This comment has been minimized.

Copy link

tobiastom commented May 23, 2017

This is awesome. Somehow it looks all documentation is only available inside the pull request.

Thank you @Mcat12 for the update!

@Mcat12 Mcat12 closed this May 23, 2017

@mikegleasonjr

This comment has been minimized.

Copy link

mikegleasonjr commented Oct 24, 2017

For those wondering how to add multiple entries, add your entries to /etc/hosts then $ pihole restartdns

@elBradford

This comment has been minimized.

Copy link

elBradford commented Jan 24, 2018

The 'solutions' here don't really do anything that editing the hosts file doesn't do already, correct? I'd love a DNS entry page in the WebUI for this purpose. I can take a crack at adding the feature if there's a chance my pull request would be approved.

@Comodore125

This comment has been minimized.

Copy link

Comodore125 commented Jan 28, 2018

Very unfortunate to see this closed.

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented Jan 28, 2018

It's been implemented in #1266 hence it was closed.

@elBradford

This comment has been minimized.

Copy link

elBradford commented Jan 28, 2018

@dschaper That merge requests allows for a single DNS entry, whereas this feature request is for multiple entries. A good solution would allow editing them from the WebUI, imo.

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented Jan 29, 2018

We can only do so much with the volunteer time we have, if you have a PR that you'd like to submit or code suggestions then we can look at implementing it. There are a lot of feature requests and none of the developers work on this full time. I appreciate the thumbs down votes, they help prioritize what we should work on next.

@pi-hole pi-hole deleted a comment from dschaper Jan 30, 2018

@PromoFaux PromoFaux changed the title Add custom DNS entrees Add custom DNS entrees [$10 awarded] Mar 5, 2018

@PromoFaux PromoFaux added the Bounty label Mar 5, 2018

@PromoFaux PromoFaux changed the title Add custom DNS entrees [$10 awarded] Add custom DNS entrees Apr 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment