Assign specific names to local hosts in pfSense?



  • Wonder if there is a simple way to assign specific names to hosts on local network in pfSense.

    For example:

    <plex_host>.localdomain.lan:32400 => plex.localdomain.lan
    <emby_host>.localdomain.lan:8096 => emby.localdomain.lan
    etc

    So ports are hidden.

    Thx


  • LAYER 8 Global Moderator

    What does it matter.. Once you go there once in your browser just save it..

    DNS has zero to do with ports.. You would have to run a webserver with a redirect, etc.. Kind of pointless.. For plex if you just hit.

    https://app.plex.tv/desktop

    You will be redirect to your local plex install..

    If I want to hit mine local I just hit
    https://nas.local.lan:32400/web/index.html

    Since the fqdn of where my plex is running.

    But with plex there is little reason to have to hit via the local name unless there is something really wrong.

    if you have problem getting to your plex UI via the above link, did you set unbound to private the direct domain?

    server:
    private-domain: "plex.direct"

    If you want to hit them by just fqdn and have them redirect you.. .Just run a webserver on the boxes to listen to default port 80/443 and redirect you to the fqdn:port



  • @johnpoz

    I agree with your points and used emby plex as examples only.
    Was wondering from technical standpoint only if that's possible.

    "if you have problem getting to your plex UI via the above link, did you set unbound to private the direct domain?

    server:
    private-domain: "plex.direct""

    I am not sure what you mean here, pls elaborate...


  • LAYER 8 Global Moderator

    Are you using resolver - default out of the box in pfsense.. or are you in forwarder mode, or using forwarder? Did you turn off rebind protection.

    Without telling unbound is a plex.direct is private its going to come back as rebind and pfsense will not give you the local IP, etc.



  • @johnpoz

    I am using resolver

    "turn off rebind protection" i am guessing is in Reserved Networks "Block private networks and loopback addresses" option ?


  • LAYER 8 Global Moderator

    Why would you have turned off rebind? Vs just putting in a setting to set that one domain as private?



  • @chudak said in Assign specific names to local hosts in pfSense?:

    Wonder if there is a simple way to assign specific names to hosts on local network in pfSense.
    For example:
    <plex_host>.localdomain.lan:32400 => plex.localdomain.lan
    <emby_host>.localdomain.lan:8096 => emby.localdomain.lan
    etc
    So ports are hidden.

    You should be able to do this by creating an SRV record. Although, I'm not sure how "simple" it's going to be.



  • @marvosa said in Assign specific names to local hosts in pfSense?:

    creating an SRV record

    I wish I knew what "an SRV record" is :)

    Happy New Year !



  • @chudak An SRV (Service) record is a custom DNS record where you can define the protocol, port, etc. Unfortunately, I only have very high-level info, so Google is your friend if you're looking for something more detailed.

    Creating an SRV record should satisfy your request. I once helped a friend create one on Godaddy so he could host multiple Minecraft servers behind a single IP by hostname only instead of the clients having to define the port on the frontend.

    So, I know it can be done, but you'll have to research the syntax for creating an SRV record in the resolver (unbound).



  • @marvosa

    Yeah sounds complicated.

    There is one solution https://github.com/cristianoliveira/ergo
    I was not able to make it work unfortunately



  • @marvosa the problem with using a SRV record is the client trying to use whatever service must use or ask for the SRV record or know to ask for it. Web browsers for example do not do this because of an old RFC.


Log in to reply