views:

385

answers:

1

I'm building a few SharePoint sites, and I want to make use of zones so I may set security different in the various zones. My workstation has a local SharePoint, and I use it for development. My workstation has a static IP, and is connected to the internet.

When I make a SharePoint site, I want to add a host header, for instance, devbox.com. I do not own this name, nor do I want to. I then add an entry in my hosts file, but when I surf to http://devbox.com:8080, it does not resolve. Do I need to register the name I want to use, or should this work, i.e., have my hosts file resolve names/IPs first?

A: 

It should work. You will need to make sure your website has the right mappings, though. For example, if you want your site to respond to http://devbox.com:8080, you'll need to either set up your website to respond to all IP addresses and port 8080, or to respond to the devbox.com host header and port 8080.

BTW, to test whether your HOSTS file is set up correcly, open up a command line and PING devbox.com. You should see the address resolved to your local machine's IP address. If not, you've done something wrong in how you've set up your HOSTS file... please post the line in the HOSTS file that you're using.

BTW, per my comment below, you should probably use 127.0.0.1 (aka localhost) in your HOSTS file line, rather than your external IP. This will remove the IP address as a potential point of failure (e.g. in case a firewall blocks the traffic)

Justin Grant
I'm using IIS 7, and I edited the Bindings setting, I added devbox.com as the Host Name, and the port I am using. Then, in the hosts file, I added the entry...<my ip> devbox.com.This should be all I need to do, right?
bmw0128
yes. you also might want to use 127.0.0.1 (aka localhost) instead of your externally-facing IP, just to ensure that there's no issue with firewall software on your external IP blocking your request. This might be a non-issue since Windows is usually good about knowing when it's talking to itself, but can't hurt to remove the external IP as a variable.
Justin Grant
thanks, the name now works, but not the port part. Do I need to do something in particular in the hosts file regarding the port?
bmw0128
nope, HOSTS file is purely for name->IP lookups. The port is handled solely within IIS. BTW, I assume in your browser you are typing out http://devbox.com:8080 and not omitting the http:// ? Some browsers are picky about requiring "http" when the port is not 80.
Justin Grant
I changed to 127.0.0.1, and I am using http://...I'll have to troubleshoot in IIS to figure out the port. One other question, my end goal is to make another site, but use a different host header. If I want test.devbox.com to work on the same IP, what changes do I make to the hosts file, just another entry like 127.0.0.1 test.devbox.com?
bmw0128
yep, add another entry to hosts file.
Justin Grant