0

I've set up Pi-hole to manage my network, and it is installed on a Raspberry pi 4 that already handles some stuff, for instance, an R-shiny server on port 3838 and a homeassistant installation on port 8123.

I want these services to be accessible through user-friendly addresses.

I added a local DNS entry so that http://raspi.local redirects to my raspberry pi, but I obviously have to add the port to the address for this to work.

I have very little knowledge of networks and maybe a little over my head here. I read everywhere that DNS has nothing to do with ports, neither /etc/host.

How could I access my services through pretty addresses such as http://raspi.local/shiny (port 3838) and http://raspi.local/homeassistant (port 8123)?

EDIT - what I've tried so far:

  • in Pi-hole, setting an IP with the port after a # or a : " throws Error while adding this custom DNS entry
  • looking up mod_proxy in Lighttpd configuration (/etc/lighttpd/external.conf) but with no sucess so far
18
  • I'd suggest looking into using a web server like nginx as a reverse proxy to handle any connections. You can then use proxy_pass to redirect connections to the correct port on localhost
    – rohtua
    Nov 9, 2020 at 20:33
  • I have no pi-hole at the moment (do not ask - just putting OS back on disk) so I'm not sure if this works. Bit concerned you have used https - as the cert could break this if it does not handle sub-domains. You must have the pi-hole as your DNS then add a local entry such as pi-hole.raspi.local with an address as 127.0.0.1#5335 or shiny.raspi.local as 127.0.0.1#3838 - if that does not work replace the hash with a colon and if that does not work try replacing 127.0.0.1 with the address of the pi-hole followed by # port number or colon port number - let me know how you get on.
    – user115418
    Nov 10, 2020 at 2:11
  • Its best to flush the DNS cache of any machine you are testing this from - do not uses th pi-hole for initial tests. Proxy set-up depends on the pi-hole web server you installed it on...
    – user115418
    Nov 10, 2020 at 2:12
  • @Andyroo Unfortunately, using # in IP causes errors in pi-hole Nov 10, 2020 at 9:12
  • Did you replace with ':' and did that work if you did?
    – user115418
    Nov 10, 2020 at 13:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.