Use hostnames or IP addresses in network - more reliable?



  • 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?



  • 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.



  • 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



  • 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.


  • LAYER 8 Netgate

    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.



  • 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.


Log in to reply