this post was submitted on 11 Aug 2023
21 points (92.0% liked)

Selfhosted

39937 readers
371 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I'm finally starting to install local web apps that my wife/kids would be interested in, and I know it has to be super easy or they're never going to go near it. Most everything is running on my Synology on different ports, with absolutely nothing exposed to the outside world, and I'd like to run local DNS and proxy so everything is available LAN-only with an easy hostname - plex.local, paperless.local, etc. (If we want remote access I'll just run Tailscale.) I'm already running PiHole, and I'm assuming if I poke around I can add local names in there, but has anybody else that's done this have any suggestions for setting things up?

you are viewing a single comment's thread
view the rest of the comments
[–] Anafroj@sh.itjust.works 4 points 1 year ago* (last edited 1 year ago) (1 children)

I don't use a pihole, but I have a pi with my favorite distro acting as server, and I use dnsmasq for what you mention. It allows to set the machine as the nameserver for all your machines (just use its IP in your router DNS conf, DHCP will automatically point connected machines to it), and then you can just edit /etc/hosts to add new names, and it will be picked up by the nameserver.

Note that dnsmasq itself does not resolve external names (eg when you want to connect on google.com), so it needs to be configured to relay those requests to an other nameserver. The easy way is to point it to your ISP nameservers or to public nameservers like those from Cloudflare and Google (I would really recommend against letting them know all domains you're interested in), or you can go the slightly more difficult way as I did, and install an other nameserver (like bind9) that runs locally. Gladly, dnsmasq allowed to configure its relay nameserver to be on something else than port 53, which is quite rare in dns world. Of course, if you're familiar with bind9, you could just declare new zones in it. I just find it (slightly πŸ˜‚) more pleasant to work with /etc/hosts.

[–] keyez@lemmy.world 2 points 1 year ago (1 children)

A pihole runs dnsmasq also so adding hosts entries and restarting the service accomplishes the same thing as adding entries via the webUI

[–] Anafroj@sh.itjust.works 1 points 1 year ago

Oh, ok. Thanks for letting me know. πŸ‘οΈ