Reaching service through domain from local network
from adidas423@lemmy.janiak.cc to selfhosted@lemmy.world on 22 Apr 12:14
https://lemmy.janiak.cc/post/377703

I think i have a stupid question but i couldn’t find answer to it so far :( When i want to reach a service that i host on my own server at home from the local network at home, is using a public domain effective way to do it or should i always use server’s IP when configuring something inside LAN? Is my traffic routed through the internet somehow when using domain even in LAN or does my router know to not do this?

#selfhosted

threaded - newest

[deleted] on 22 Apr 12:19 next collapse

.

TheButtonJustSpins@infosec.pub on 22 Apr 13:03 next collapse

You want to split your domain so it resolves to a private IP internally and a public IP externally. So, your internal DNS server should return internal IPs.

atzanteol@sh.itjust.works on 22 Apr 14:39 next collapse

Some routers will allow you to reach the external IP from inside your network, some may not. Mine currently does which is great (I can access www.example.com which resolves to my external IP address and it is forwarded as though I were outside my network).

What I do is register public domains on “example.com” and I have a sub-domain for internal IPs (home.example.com). My local DNS server responds for home.example.com and forwards for the rest.

This makes it clear to me which address I will be getting. And since all my public web traffic goes through a reverse-proxy it lets me also have a name for the server itself. e.g. “music.example.com” may go through the reverse proxy for my music server, but “music.home.example.com” resolves to my music server directly. So I can use the latter for ssh and other things.

Decronym@lemmy.decronym.xyz on 22 Apr 14:45 collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DHCP Dynamic Host Configuration Protocol, automates assignment of IPs when connecting to a network
DNS Domain Name Service/System
IP Internet Protocol
NAT Network Address Translation

4 acronyms in this thread; the most compressed thread commented on today has 9 acronyms.

[Thread #702 for this sub, first seen 22nd Apr 2024, 14:45] [FAQ] [Full list] [Contact] [Source code]