Forwarding DNS traffic internally within a network.
Forwarding DNS traffic internally within a network.
This method is the best way to handle DNS names. However, it seems the person asking might actually want a proxy instead of a DNS resolution.
Usually, domain providers let you configure your own DNS servers for the domains you manage, such as with Namecheap.
Yes, this applies specifically to your environment. However, if you have two web servers with multiple domain names in your network, you can only forward traffic through one port at a time. You could manage this internally using a DNS service. For external access, you’d need a VPN that connects into your internal network or set up a proxy server. When you enter a domain name, it routes you through the proxy and directs you to the correct server. It functions somewhat like internal DNS but adapted for external connections.
DNS and proxy serve different purposes. Even with a proxy in place, DNS remains necessary for resolving domain names.
Review your domain-name provider's configuration to see if they allow you to set up your own DNS server for your domain. This is usually not necessary because most providers provide solid DNS services themselves, including automatic updates when your IP address changes. As a long-time Namecheap customer, I manage several domains using their servers and automatically update records through my Pfsense router.
It's possible I misinterpreted. You're asking if I should get this exactly right.