I'm trying to set up DNS for a website that has the same name as my Active Directory domain, and I'm running into some challenges. Generally, I would just create an A record and guide users to www.contoso.com, but using the website's IP doesn't work because there are multiple sites hosted on that IP. It seems that I need specific header information for requests. Additionally, the website is resolving to contoso.com instead of using www first, which seems to be another issue. I've tried researching but haven't found a solid solution. I've heard that a conditional forwarder could work, but I'm not optimistic. Any ideas?
3 Answers
Are you considering SNI? Trying to use the IP for a website can complicate things. An A record pointing to the IP you're using is essential. Since your internal AD domain is contoso.com, you might face issues accessing the external site with the same name. It's best to create a record for www.contoso.com pointing to that IP instead to simplify the setup.
This is a common issue, usually caused by misconfiguration. Have you verified if the web server is set up to respond to requests for www.contoso.com? Each web server has its own way to do this; for instance, with Apache, you'd configure a virtual host for that. Since it sounds like you're pretty experienced, you might already know this, but it's worth confirming.
When you mention that it requires header info, are you referring to the Host header? If you only have one public IP, you might want to set up a reverse proxy using something like NGINX. It can handle the TLS termination and forward the requests appropriately to the right web application behind it.

You're right, I'm an engineer and no expert in DNS! The server isn't set up to respond to www.contoso.com.