Local Domain Has The Same Name as Public Website Domain

Table of Contents

Local Domain Name Same As Website

Best practices for Active Directory (AD) domain design advise against using a registered domain name as the name of an AD domain. Viable alternatives include using a non-public DNS suffix (.local or .lan, for example) in the AD domain name.

In this case, the company’s website, can’t be reached from inside the office by machines joined to the AD domain, but machines outside the office have no issues reaching the website.

Local Domain Has The Same Name as Public Website Domain

The issue arises because a local DNS server that has a particular lookup zone in its database and point to domain controllers that have not any website.

Local Domain Has The Same Name as Public Website Domain

Solution 1: Using local DNS Server

The solution to this issue is simple: create a host record named www in the domain.com zone on the Domain Controller and give that record the website’s public IP address. Machines that query that DNS server then receives the correct response and be able to browse the website.

Local Domain Has The Same Name as Public Website Domain

Internal users would be access the company website with www.domain.com.

Using this solution, user must add www prefix to access the company website, it’s inconvenience. Let move forward to the next solution to dealing with this issue.

Local Domain Has The Same Name as Public Website Domain

Solution 2: Using Nginx to serve as a web server

Note

You must run Nginx in Domain Controllers

1. Download then extract downloaded file Nginx for Windowshttp://nginx.org/en/download.html

2. In the extracted folder, navigate to conf folder.

Local Domain Has The Same Name as Public Website Domain

3. Open nginx.conf using any text editor.

Local Domain Has The Same Name as Public Website Domain

4. In the server block, add this line to redirect from domain.com to www.domain.com.

rewrite ^(.*) http://www.domain.com$1 permanent;

Note

When using this solution, the www record in the local DNS server still required. So, be certain, you’ve create www record in local DNS.

Local Domain Has The Same Name as Public Website Domain

5. Save the configuration file then open nginx.exe to run Nginx application. When your server restarts, you must run Nginx app manually, let try this How to Install Nginx in Windows as a Windows Service Auto Start.

Local Domain Has The Same Name as Public Website Domain

Now, internal users can access the company website without www prefix. Just simple type domain.com in the address bar.

Local Domain Has The Same Name as Public Website Domain

Leave a Comment

Required fields are marked *