Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Use hostnames or IP addresses in network - more reliable?

    Scheduled Pinned Locked Moved General pfSense Questions
    6 Posts 4 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FlashEngineer
      last edited by

      I was thinking the other day, what if I mapped all my hosts IP into hostnames into DNS so I can access them via hostname instead of 192.168.x.x?  Then if I ever change configuration that involves subnet change, all my applications, configs would not have to change since everything is mapped to hostname.  I would only have to change DNS mappings.

      Is this more robust or it's better stick with IP address so in event pfsense goes down, you can still access hosts?

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        DNS is a merely a convenience for humans who have a much harder time remembering sequences of numbers than they do names.  DNS can be a point of failure, which is why it is always recommended to have at least 2 active DNS servers.  The use of IP addresses is more stable, but also more difficult to manage, so you have a trade-off to consider: convenience vs stability.  You can use both, as well.  For example, in my network we have DNS of course, but my critical cluster nodes all talk to each other via IP address exclusively even though the nodes all have hostnames.  And that's on a trusted network.  Public networks introduce other issues such as DNS security & attack surface to name a few.

        Is this a home network or business?  How often do you figure you're going to renumber your network?  That in itself isn't very common unless you've made a mistake somewhere during the design phase.

        1 Reply Last reply Reply Quote 0
        • F
          FlashEngineer
          last edited by

          Definitely convenience, just configuration of Desktops/mobile/apps would be easier if all were hostnames.

          Anyhow, this is just one time reorganization on my home network to another subnet as I placed it within some VPN's dhcp range by accident… haha

          1 Reply Last reply Reply Quote 0
          • KOMK
            KOM
            last edited by

            Sure then, go ahead and create a bunch of A records for your devices.  Besides, if your DNS goes down then you likely have bigger fish to fry than worrying about name resolution.

            1 Reply Last reply Reply Quote 0
            • DerelictD
              Derelict LAYER 8 Netgate
              last edited by

              For any network of any decent size, hostnames all the way.  Evaluate how long it will take you to change all the IP addresses vs how long it will take you to set up DNS once.

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

              1 Reply Last reply Reply Quote 0
              • R
                robatwork
                last edited by

                Counter-intuitively, DHCP makes things much easier and more controllable. That way all your PCs get the same DNS servers, gateway, time server and everything else. More importantly if you want to change something globally like a subnet, then change it once and DHCP will handle it all in conjunction with DNS.  However I am talking about a real DHCP server, not the cut down abominations in most home routers.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.