Replace ip with local domain reddit / selfhosted ---------------------------------------------------------------------- _-_Karl_-_ · 2023-10-12 09:10 Hello! I'm intrested in redirect a custom domain like portainer.local, adguard.lan, [jellyfin.xyz](https://jellyfin.xyz) to my server ip and port. I saw online some options like the adguard's dns rewriter but it doesn't support the port, just the ip address. I also have an ngnix proxy server if could help. I'm pretty sure that is possible because i was making some experiment with another little server and klipper for my 3d printer and with no manual configurations it was reachable thru a .local/.xyz domain ---------------------------------------------------------------------- bufandatl · 2023-10-12 09:26 Use your nginx server as reverse proxy. Have the domain show to the nginx server and nginx then can proxy the traffic to the serveice you want to have access to. ---------------------------------------------------------------------- thekrautboy · 2023-10-12 09:47 > custom domain like portainer.local, adguard.lan, jellyfin.xyz Please do not make up fantasy domains and TLDs. For private use, use the TLDs that are meant for it, such as `example.lan` or `example.private` or `example.home.arpa` Avoid using `example.local` because `.local` is already used by mDNS. > I saw online some options like the adguard's dns rewriter but it doesn't support the port, just the ip address. Yes, because thats what DNS does does. It doesnt care about ports. > I also have an ngnix proxy server if could help. Thats the typical answer to your question. A reverse proxy can turn `http://192.168.0.150:9000` into `http://portainer.lan` You need some form of local DNS which points the name `portainer.lan` to the IP of the proxy (not the IP of portainer), but since you mention Adguard you could simply add these records to Adguard. In addition most proxies can also serve SSL, for example with free valid certs from Lets Encrypt. For that you need a valid domain, it doesnt need to be a paid one. You could use free (sub)domains from DuckDNS.org, dedyn.io or nic.eu.org for example. Then you could use `https://portainer.example.duckdns.org` Thousands of guides and tutorials exist on how to setup your favorite reverse proxy with Pihole/Adguard, and with Lets Encrypt. There is no need to write another one. **This exact question has been asked a million times on this sub already, please just use the search.** ---------------------------------------------------------------------- _-_Karl_-_ · 2023-10-12 10:19 Yeah, maybe I've been a bit lazy and I didn't use the search function, I'll promise I'll use it in the future before asking to avoid duplications. Thanks for the help ---------------------------------------------------------------------- thekrautboy · 2023-10-12 10:22 Duplications are not a problem, its the nature of reddit that nobody really cares about a thread that was active months ago. But for questions that get asked and answered more than once a week, its just a waste of everyones time, including your own. ---------------------------------------------------------------------- Kernel_Mustard_ · 2023-10-12 12:35 FWIW, the use of .lan or .private etc. as a TLD for an intranet is discouraged both in RFC 6762[[1](https://www.rfc- editor.org/rfc/rfc6762)] and by Microsoft in their domain naming consi deration[[2](https://social.technet.microsoft.com/wiki/contents/articl es/17974.active-directory-domain-naming-considerations.aspx)]. The idea behind this is that if one day these TLDs were to become available as gTLDs, this could mess up your internal DNS resolvers. I doubt this would happen considering how many companies use these, but it's a good thing to keep in mind. ---------------------------------------------------------------------- thekrautboy · 2023-10-12 12:43 True. But you can probably also find another RFC that still recommends those. The point is people should not use actual domains that they dont own (making up jellyfin.google.com) and should not use TLDs that dont exist at all (making up jellyfin.homeserver). If they use jellyfin.private or jellyfin.home or jellyfin.lan has no realistic impact at all. Maybe in 50 years from now, but i honestly am fine with ignoring that "risk". ---------------------------------------------------------------------- Full_Turnover_4263 · 2023-10-12 14:25 PiHole makes this easy (they have a whole section dedicated to local DNS and CNAME). Create a DNS record for nginx, then CNAME everything to it. If you ever move or change your nginx server, you only need to make one update. Would also buy a domain name and use subdomains for everything on the LAN (jellyfish.home.yourdomain.com). ---------------------------------------------------------------------- flaming_m0e · 2023-10-12 14:55 >I saw online some options like the adguard's dns rewriter but it doesn't support the port, just the ip address. Because DNS is for the resolution of IP and NAME, not port. You would use a reverse proxy to point to a port. ---------------------------------------------------------------------- PaulEngineer-89 · 2023-10-12 16:02 RFC 2606 lists reserved TLDs. .local has indeed become “used”. Just 4 TLDs have been reserved: test, example, invalid, and localhost. So obviously .localhost is what is reserved specifically for local use. It’s unfortunate it’s not short like lan. You can of course use lan or home but you risk someone else using it like .local. ---------------------------------------------------------------------- sengh71 · 2023-10-12 16:14 It's possible, and neatly explained by u/thekrautboy You can follow Wolfgang's blog post around this exact thing: [https://notthebe.ee/blog/easy-ssl-in-homelab- dns01/](https://notthebe.ee/blog/easy-ssl-in-homelab-dns01/) ---------------------------------------------------------------------- MuffelMonster · 2023-10-12 20:02 I am linking ips with local domain names and machine names in ubound, which runs on my opnsense router. It even has the possibility to auto assign names and domains over dhcp. I have set my local domain ".home", connected dhcp and dns server. If I now switch on e.g. my laptop, it pulls an ip address from dhcp and ubound adds a link between the ip and laptop.home, and I can connect to it using the name instead of the ip. ---------------------------------------------------------------------- sowhatidoit · 2023-10-12 20:22 What is the advantage of having your own domain? I use piHole but none of my services are exposed to the outside. ---------------------------------------------------------------------- thaneekl · 2023-10-12 21:06 way more easier to deal with https cert ---------------------------------------------------------------------- sowhatidoit · 2023-10-12 21:16 So let's say I use SSL for mydomain.com AND create a subdomain lab.mydomain.com to use for my homelab AND don't want lab.mydomain.com to access my services from the outside. Is that possible? ---------------------------------------------------------------------- ropaga · 2023-10-13 06:57 You can use the host file in your client https://en.m.wikipedia.org/wiki/Hosts_(file) ---------------------------------------------------------------------- _-_Karl_-_ · 2023-10-13 07:42 It depends, I've exposed service that I need to reach outside like nextcloud or navidrome for the music