11
submitted 1 year ago* (last edited 1 year ago) by Scrath@feddit.de to c/selfhosted@lemmy.world

Hey everyone, I wanted to ask for some help regarding my DNS setup and for routing requests to my selfhosted services.

Currently I use Pi-Hole as a DNS server with my routers default DNS server as the upstream server. This allowed me to define local DNS entries using Pi-hole and route my requests to these domains directly to my local services. For example I bought a domain a while ago and in preparation for setting it up, I had it entered as a local DNS entry pointing directly to my servers IP address.

Earlier today I finally got around to setting up a cloudflare tunnel to expose one of my services to the outside world using the domain I bought. Ever since I did that, all requests to that domain seem to exit my home network, go through cloudflares network and then return through the tunnel, even though I have a local DNS entry for that domain name.

What I would prefer is for the request to be routed directly to my server instead, since I am in the same network already. Since my DNS server is the Pi-Hole, I figured this should happen automatically.

Is there an issue with my Pi-Hole setup? If there is any information missing I'll be happy to provide it. I wasn't sure what information I could safely post here.

Solution

I think I managed to fix the problem. After enabling the option Never forward reverse lookups for private IP ranges in Pi-Hole and clearing my DNS cache again, nslookup only returns local IP addresses instead of the IPv6 address of two cloudflare servers.

you are viewing a single comment's thread
view the rest of the comments
[-] uninvitedguest@lemmy.ca 1 points 1 year ago* (last edited 1 year ago)

Some things that stand out to me:

  1. You're using your router's default DNS as the upstream server. Try specifying an upstream DNS in the settings instead.

  2. Try Pihole + Unbound

  3. Could you provide an anonymized example of how you set up the local DNS entry? E.g. Domain: sub.domain.com IP: 192.168.X.Y

[-] Scrath@feddit.de 1 points 1 year ago

Thanks for your reply. I think I managed to solve this issue and have updated my post to reflect this. Apparently I had a setting disabled in Pi-Hole which caused my DNS requests to be forwarded upstream for some reason, even though there existed a local DNS entry.

this post was submitted on 19 Sep 2023
11 points (100.0% liked)

Selfhosted

40152 readers
533 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