in

Bunker Hollow

Matt Williamson's home on the web, welcome.

Matt Williamson's Blog

Personal discoveries of an IT professional.

Self-Hosted Website URL/FQDN/DNS Name Considerations

| Share

I've learned a great deal since first configuring my network almost two years ago.  Most of the mistakes I made along the way have been corrected, others I've delayed fixing if I have a temporary work around.  This particular issue I've put off for far too long and now, unfortunately, it's impossible to fix.  Shame on me for procrastinating.

Before I get to the problem, I have to elaborate on my design.  I built a domain controller that is my primary DNS server.  Then I configured my firewall to forward all DNS requests to my primary DNS server.  Then I have a webserver.

The problem is threefold:

  1. A ping or nslookup of the domain itself (eg: ping bunkerhollow.com), from inside the network, returns the IP of the firewall.
     
  2. For the sake of search engine optimization, my website redirects all subdomains to the root (eg: http://www.bunkerhollow.com is redirected to http://bunkerhollow.com).  The reason for this being, if half the people link to your articles with the www and half the people link to your articles without the www, your SEO score is potentially only half of what it could be.  That's how I understand it anyway.  So at some point I decided to redirect everything to http://bunkerhollow.com, just because it's shorter.
     
  3. Outside of my network, everything works fine.  Inside my network, browsing to http://bunkerhollow.com takes me to my firewall web access (because of item 1).  So OK, I'll setup a DNS CNAME ALIAS.  Now I browse to http://bh/ to get to the same place.  Which works fine until I start writing blog posts or uploading images.  My Community Server website uses the domain from the URL for certain things so if I post from inside the network then it's not accessible from outside of the network and vice versa.

My current solution is to now modify the hosts file on each internal machine that I'll use to post content.  I add an entry that associates bunkerhollow.com with my webserver IP address, overriding the default that always takes me to the firewall instead.

 The better solution though, now that I'm aware of the entire problem, would be for me to redirect all of my traffic to http://www.bunkerhollow.com.  I would have no problem accessing that from inside or outside of the network.  Too bad I can't make the change now, I have way too many links floating around in cyberspace pointing to the current setup...

... but wait, I think I could still change it.  If everything is automatically redirected then any link out there that is http://bunkerhollow.com/ABC should work just fine if it's redirected to http://www.bunkerhollow.com/ABC.

... I'll have to think about this a bit more ...

UPDATE 2009-06-08

I made the switch.  I've set Community Server to redirect all traffic to http://www.bunkerhollow.com and luckily any existing links out there redirect to the new correct address without any problem.  I now use that URL whether I'm inside or outside of my network and everything works as it should.  The only catch was I had to write a SQL query to update any hard links that had been saved in any blog posts or any other website content.

Comments

 

goliad isd » Blog Archive » A Look Behind China’s Great Firewall said:

Pingback from  goliad isd  » Blog Archive   » A Look Behind China’s Great Firewall

June 6, 2009 11:46 AM
 

Matt Williamson said:

Updated.

June 8, 2009 10:00 AM
 

Toki said:

Matt, ı have learned too much from your blog thanks.

August 29, 2009 7:08 AM
 

Shortcuts to Internet Millions said:

I rarely post, but I wanted to say thanks for sharing this information. Understanding the net better and better.

October 19, 2009 10:42 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
Powered by Community Server (Non-Commercial Edition), by Telligent Systems