My active directory domain's name is "mywebsite.com" instead of "mywebsite.local". I had to do this as a workaround to other issues, and to change it will be a pain. When people inside of my company visit "mywebsite.com", it redirects to our DC instead of our website. How can I make it redirect to our website?
5 Answers
You can't.
You can define any hostname or subdomain you want in your AD's main DNS zone, but for AD to work properly, the A records for the domain itself must point to your domain controllers.
So, having "www.mywebsite.com" pointing to your web site is fine, but having "mywebsite.com" do the same is not.
Addendum: hosting your web site on your DC would of course fix the issue, but I strongly advise you against that; DCs are definitely not meant to host web sites.
- 72,827
You really shouldn't use the .local TLD (or any made up TLD) or the address of a public website. You should use a sub-domain of a domain that you already own (i.e. internal.mywebsite.com).
The best thing to do is rename your Active Directory Domain. You can't do this if you have Exchange 2007 or 2010 installed, but you can certainly reinstall it in the new domain.
If you don't want to do a rename, which is really the best thing to do, you can do some voodoo like install IIS on all of the DCs that redirect to the external site, but that's a bad fix. Really, just do a domain rename and learn from your mistake.
- 101,323
I always name my internal ad domains ad.companyname.com so I'm
- not using .local or a made up TLD.
- using a real TLD so I can get appropriate Certs and avoid DNS issues.
- 41
I'm going to repeat what uSlacker has mentioned above with a bit more detail as what he says will work. The rather pedantic arguments above are valid but I'll let you decide on whether you want a solution today or would prefer to spend several risky days migrating your domain or renaming it.
Its not much of a problem - you should be able to do this in 30 mins or less. It will not affect the operation of AD in the slightest.
- Add an entry in your local dns server on your DC for www (www.mywebsite.com). Put the public ip of your public web site.
- Install iis on your dc (if you have more than one you will need to do this on each one)
- On the default web page (of each dc) modify index.htm so that it redirects to www.mywebsite.com
Anyone in the office who types www.mywebsite.com will directly open the public site.
Anyone who types mywebsite.com will open the default web page on the DC and it will redirect to www.mywebsite.com
You could be more sophisticated and create an IIS site with a header of mywebsite.com and put the redirect there so as not to modify the default web site. If you already host other web apps on your DCs then this would be cleaner. Your call.
- 1,359
I believe you can make this work, but it adds a bit of risk to your setup. You would need to add IIS to your domain controllers. Then redirect the index.asp to www.yourdomain.com. If you have multiple DCs, you'd need it on each.
I do not recommend this approach, but instead tell folks is cannot work as we have done. However I realize business needs may mandate a solution.
- 6,452