Set up Intranet
Hi guys, Here's the situation. I want to set up a personal intranet site on my home computer. Currently I have two computers (which I have yet to network, but I'll get there). One is Windows 7 32-bit, the other is a Windows XP machine. I've installed IIS and PHP on the Win7 machine. I have the intranet file directory created on the root of the C: drive as well. My question now is, what do I need to configure so that I can type in the address (for example, intranet.domain.com) in a browser from either machine to access the website?Click Start, click Run..., type "cmd" and hit enter, type "work /now"
August 19th, 2010 2:43am

Well, the "work /now" command is not going to work for this situation. Having an internal DNS server is the best option for name resolution. However, it would be hard to justify for two computers on a network. Therefore, the next recommendation would be to modify the HOSTS file for each computer. The HOSTS file is located in the %systemroot%\system32\drivers\etc\ directory. open the file with a text editor (notepad as an example) and add a entry for intranet.domain.com with the IP address of the Windows 7 computer. Save the file (do not save as a .txt file). Make sure the Windows 7 computer doesnt change its IP address by either using a static IP or creating a DHCP reservation. Otherwise when the IP changes, you will not be able to resolve the host name intranet.domain.com to the new IP. Do this on both computers. That's it. Visit: anITKB.com, an IT Knowledge Base.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2010 4:22am

Well, the "work /now" command is not going to work for this situation. Having an internal DNS server is the best option for name resolution. However, it would be hard to justify for two computers on a network. Therefore, the next recommendation would be to modify the HOSTS file for each computer. The HOSTS file is located in the %systemroot%\system32\drivers\etc\ directory. open the file with a text editor (notepad as an example) and add a entry for intranet.domain.com with the IP address of the Windows 7 computer. Save the file (do not save as a .txt file). Make sure the Windows 7 computer doesnt change its IP address by either using a static IP or creating a DHCP reservation. Otherwise when the IP changes, you will not be able to resolve the host name intranet.domain.com to the new IP. Do this on both computers. That's it. Haha, well "work /now" should work. lol. Is it possible to set up the Win7 computer as a DNS server? I'm planning on adding another one, maybe two, computers to the network sometime in the future. Or do you still recommend the HOSTS file modification? It doesn't sound hard, though I'm not 100% sure how to set up the static IP or DHCP reservation. I think I can figure it out, but pointers are welcome.Click Start, click Run..., type "cmd" and hit enter, type "work /now"
August 19th, 2010 4:36pm

"Is it possible to set up the Win7 computer as a DNS server?" No, or at least I've never heard of it being done. Win7 traditionally acts as the client, not the server, for services like DNS. If you wanted to use something like DNS you could implement BIND, but that is not part of Windows & would invovle setting up a *nix system. "adding another one, maybe two, computers " I would recommend sticking with modifying the HOSTs file on each machine as needed for IP to name resolution. "It doesn't sound hard, though I'm not 100% sure how to set up the static IP or DHCP reservation. " Modifying the HOSTs file on each machine to allow for IP to name resolution is very straight forward. http://technet.microsoft.com/en-us/library/cc958812.aspx DHCP reservations have nothing to do with setting up an intranet in your case of ~ 4 machines. Not only is it utterly not needed, but it would be overkill. To use DHCP reservations would imply that you're using your router or a DHCP server to handle IP delegation, but in your circumstances with so few systems it's not really practical. I would advise just assigning static IP addresses & modifying the HOSTs file as needed. http://www.tech-faq.com/how-to-set-a-static-ip-address-in-windows.html
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2010 7:37pm

Ok, thanks! I'm not at my computer right now, but I'll let you know how it goes when I get back to it.Click Start, click Run..., type "cmd" and hit enter, type "work /now"
August 19th, 2010 7:57pm

Hello jkloth1, cschaar's responses to your questions are on target with what I would have recommended for your situation.Visit: anITKB.com, an IT Knowledge Base.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2010 10:48pm

Ok I just tried adding a record to the HOSTS file on my computer here at work to test it out. But it doesn't work. How am I supposed to save this file? When I try to save it using notepad it always saves as a regular txt file. What file extension is this supposed to have? EDIT: Nevermind. For some reason I couldn't use Notepad. Notepad always threw an error when I tried to save and then saved the file as a txt file. I used a different text editor and it worked. Thanks again guys! I'll give this a shot when I get home. Click Start, click Run..., type "cmd" and hit enter, type "work /now"
August 19th, 2010 11:55pm

Hello jkloth1, Yes, when you use notepad, you had to pass the "work /now" parameters. Just kidding. If you decide to use notepad, you cannot save the file as a text file. What you can do is run NOTEPAD as admin (elevated rights), then you should be able to save. Also, just for your FYI, using notepad, you can do a "Save As", place quotes around the file name, and choose the "All Files" as file type. IN any case, it appears you got over that hurdle. Feel free to post an update when you try it at home. Visit: anITKB.com, an IT Knowledge Base.
Free Windows Admin Tool Kit Click here and download it now
August 20th, 2010 4:43am

Ok I just tried adding a record to the HOSTS file on my computer here at work to test it out. But it doesn't work. How am I supposed to save this file? When I try to save it using notepad it always saves as a regular txt file. What file extension is this supposed to have? EDIT: Nevermind. For some reason I couldn't use Notepad. Notepad always threw an error when I tried to save and then saved the file as a txt file. I used a different text editor and it worked. Thanks again guys! I'll give this a shot when I get home. Click Start, click Run..., type "cmd" and hit enter, type "work /now" I think the reason you wouldn't be able to edit the hosts file while at work is because you don't have admin rights on your work pc?
August 20th, 2010 12:22pm

I think the reason you wouldn't be able to edit the hosts file while at work is because you don't have admin rights on your work pc? I can guarantee that's not the problem. I'm a system administrator. :P Yeah, I know what kind of system admin doesn't know how to set up an Intranet, right? The kind who's still learning. ;) At any rate, I did get the hosts file modified and it redirects me to my Intranet site. Thank you guys for all your help.Click Start, click Run..., type "cmd" and hit enter, type "work /now"
Free Windows Admin Tool Kit Click here and download it now
August 20th, 2010 4:25pm

jkloth1: That is the problem. Though you are the admin of the PC, the drivers/etc/hosts file is a protected system file. You can edit the hosts file with notepad when you start notepad as admin. To accomplish this go to the start menu and find the notepad program and right click on it and you will see the context menu item which I believe says "start as Administrator" or something to that effect. Once notepad opens you can naviagte to c:\windows\system32\drivers\etc and open the hosts file. Edit the file and then click file:save (not save as).
August 20th, 2010 5:24pm

I need to resurrect this thread. I've got everything set up, and it works like a charm. However, now I have need to create a "Subdomain" if you will. Right now I have the HOSTs file set up to redirect portal.domain.com to my Win7 machine which is acting as the webserver. This takes me to the web root which is fine. But I'd like to be able to type sub.domain.com to redirect to webroot/subdomain and still be able to type portal.domain.com to get the webroot. Is this possible with a HOSTs file? (more importantly, does my question make sense... :P)Click Start, click Run..., type "cmd" and hit enter, type "work /now"
Free Windows Admin Tool Kit Click here and download it now
December 13th, 2010 3:01pm

You could have both host names, portal.domain.com and sub.domain.com directed to the same web. 1) For name resolution, you'll need both hostnames to point to the same host 2)On the webserver, since you want both URLs to point to the same website, the easiest method is to configure the web server to use host headers. You configure that in the properties of the website in the IIS admin console (Bindings). If you have other IIS related questions, I would recommend that you post those in the official Microsoft IIS forum, http://forums.IIS.net Visit: anITKB.com, an IT Knowledge Base.
December 13th, 2010 5:14pm

You could have both host names, portal.domain.com and sub.domain.com directed to the same web. 1) For name resolution, you'll need both hostnames to point to the same host 2)On the webserver, since you want both URLs to point to the same website, the easiest method is to configure the web server to use host headers. You configure that in the properties of the website in the IIS admin console (Bindings). If you have other IIS related questions, I would recommend that you post those in the official Microsoft IIS forum, http://forums.IIS.net Visit: anITKB.com , an IT Knowledge Base. That is exactly what I ended up doing. Thanks, though! And I'll be sure to post in the IIS forums with future questions. (Which I'm sure to have ;) )Click Start, click Run..., type "cmd" and hit enter, type "work /now"
Free Windows Admin Tool Kit Click here and download it now
December 17th, 2010 12:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics