Thursday, November 19, 2009

Understanding DNS

The Domain Name System puts a friendly face on the Internet. Let's put it this way... what's easier to remember: www.google.com or '64.233.161.104'? Right, we agree.

To your browser, the above two entries become one and the same thanks to the magic of DNS. What the system does is to map domain names like Goole.com to IP addresses like '64.233.161.104'.

For example, when you type www.pcstats.com into your browser's address bar, the computer sends that address to a DNS server on your network or the Internet, looking to have it translated into an IP address that it can contact directly. That DNS server will send back the IP address if it knows it, and if it doesn't, it will contact other DNS servers all the way up to the root of the Internet until it finds the address it's looking for. The entire process generally takes less than a second.

Internet Service Providers generally assign each customers computer a DNS server to contact when the connection is first set up. If you are using a home Internet sharing device, it will receive DNS requests from your network and pass them on to the ISP's server. Without a DNS server, the web browser will be unable to transform domain names (URLs) like www.pcstats.com into IP addresses, and thus cannot access web pages.

DNS and Website Hosting

Technically, you don't NEED a domain name to host a website. If your home computer is connected to the Internet with IIS running, and you have created a web page (in a special folder), anyone on the internet can access that information by typing the IP address of your home computer into their web browser.

If you want to have a website that people will actually visit though, it's best to get a domain name, preferably a catchy one.

How do I get a DNS domain name for my website?

To get a domain name, you'll need to register your choice with one of the many, many domain name registration services. Network Solutions is the grandaddy of them all, but there are other independent companies which offer more competitive pricing on a yearly, or multi-yearly basis. It pays to do some research, and we would suggest choosing a domain name registration provider based in your native country if at all possible. A central body governs all domain names on the Internet, and the various registration services have acquired permission to lease them to you for a period of time, usually starting with a minimum of 2 years.

Once you have found a domain name registration service provider you like, the next issue is ensuring the domain name you've chosen is not already registered. It it is free, you can choose the extension (ie. .com, .org, .net, etc.) and register that name. The registrar will always run a search to see if the particular domain name you have chosen is already taken, so there is no chance of two individuals owning 'Google.com' for example. Fees will vary, but in all cases you are registering that domain name only for a certain length of time, measured in years.

Once you have registered your domain name, you can use the domain name registration service's tools to map it with your computer's IP address. From this point on, anyone who enters your domain name into a web browser will be directed to your IP address.

Domain names and websites


Do you have to register a domain to have a website?

No. The advantage of paying for a domain name is that you get to choose an easy and memorable word that people can type into their browsers to reach your website. Otherwise there are many free services that will cheerfully provide you with one of a limited set of domain names, and you can even just use your IP address as the way to contact your website (though this will not work if you have a dynamic IP connection, more on that below). We'll go into these services in more detail later in the article.

Static IP versus dynamic IP

If you want to host a website, you need to know whether your ISP assigns your PC a static (rarely changing) or dynamic IP address. Many cable-based ISPs provide static addresses, while most DSL providers use dynamic IP addresses which change every time your computer connects to the internet. There are exceptions to both of these rules though, so the best way is to contact your provider and ask. Alternately, you can monitor your IP address over the course of a couple of days of normal use (including connecting and disconnecting from the Internet if you are using DSL) to see if it changes.

A static IP address is very easy to host a website with, while dynamic addresses introduce a few more complexities. It's quite possible to do it either way though, so don't worry.

As above, to check your Internet IP address, sit at the computer your DSL or cable modem is connected to and go to 'start\run' and type 'cmd' to bring up the command prompt, then type 'ipconfig'.

If you use a router or Internet sharing device, go to the status menu to check it's current IP address. Make note of this IP number.

Part 2: Hosting a Website andInstalling IIS

Now let's get down to business. To host a website on your home PC, you will need to have Microsoft's IIS (Internet Information Server) installed on a Windows XP Professional or Windows NT/2000 system. There are other hosting programs out there, like Apache, but that is beyond the scope of this guide.

The first order of business is to make sure you have IIS installed. Go to 'control panel\add or remove programs'. Next, click the 'add/remove Windows components' button on the left.

From the new window, scroll down until you find 'Internet Information Services (IIS)'. Check this entry if necessary, then Double click it. If it is already checked this means IIS is installed on the computer.

Scroll to the bottom and ensure that the World Wide Web service is checked. Uncheck the SMTP and FTP service for now. Click OK, then OK again. If IIS was not previously installed, you will need to insert the original Windows Installation CD to install it now.

Making a website Accessible from the Internet

The first thing we need to do is to prepare any firewall software or hardware that is currently guarding your system.

With the modern Internet's virus and malware-infested climate, just about every computer uses some form of firewall software or hardware. Since firewalls block all unsolicited incoming data by default, they can make it rather hard for people to view your website. In order to browse to your site on your home PC, potential readers must first send data through port 80 to IIS on your computer. Firewalls will block this incoming traffic, stopping your website from being accessed.

To get around this problem, you need to create an exception or virtual server. Depending on the type of firewall you use, this means one of several different processes. If you use a personal firewall like theWindows XP Frewall or Zonealarm, you need to authorize IIS to act as a server.

To do this in the pre-service Pack 2 version of the Windows XP Firewall, find your Internet connection by going to 'my network places' then 'show all connections.' Right click on your Internet connection's icon and hit 'properties' then 'settings'.

In the 'services' tab, scroll down until you see 'web server (HTTP)' and check its box.

In the post-SP2 version of the Windows XP Firewall, you can allow web traffic to pass through to IIS by going to 'start\control panel\windows firewall' then opening the 'advanced' tab.

Highlight your Internet connection in the 'network connection settings' window, then click 'settings.'

From this screen, place a checkmark in the HTTP box and hit 'ok.'

If you use an Internet sharing device like a home router as your firewall, you will need to create a virtual server (also known as port forwarding) to allow your website to be accessible over the Internet.

A virtual server is a set of instructions given to the home router, telling it that if data comes in over a specific port (say TCP port 80 for hosting a website) that data should be allowed through the firewall and forwarded to a specific computer inside the network. In this way, you can make your website (or whatever else) available without otherwise compromising your firewall security.

Creating a virtual server tends to be the same in almost all home router models. First consult your documentation to find the configuration page for 'virtual servers' or the equivalent.

When creating a virtual server, you will need to first enter the IP address of the computer that is hosting the website. Next you need the port that data enters that system on. Enter TCP port 80, since this is the default port for HTTP.

Finally, you need to choose the port that will be open on the router to receiver the data. In most cases, this will be the same as the port on your hosting computer, so enter 80 here too.

Once you save this information, all data coming from the Internet to the firewall on TCP port 80 will be allowed through the firewall and redirected to your hosting computer, thus allowing access to your website.

Now that your firewall is going to allow web traffic into your computer, let's take a look at how to prepare your website for using either a static or dynamic IP from your broadband internet service provider. Depending on your connection type, just go to the appropriate page below.



Hosting a website on a dynamic IP Internet connection

Most DSL broadband internet service providers and many cable companies change the IP addresses of their customers frequently. In the case of DSL, the change generally occurs each time the customer connects to the Internet, while with cable, the changes can occur at any point.

It might seem impossible to host a web site from an IP address that potentially changes every day, but it can actually be done quite easily through the magic of dynamic DNS.

What is Dynamic DNS?

Dynamic DNS services provide their clients with a DNS address (as covered above) and install a small application on the client's computer which monitors its current ISP-designated IP address. When that IP address changes, the application alerts the dynamic DNS provider who then updates the client's DNS records with the new IP. In this way, visitors who try to access the client's web site using his DNS address will always be directed to the right IP address, no matter how many times a day it changes.

Several companies offer free dynamic DNS service over the Internet. Generally speaking, you sign on for a free membership and pick a DNS name from the ones the company has on offer. This does provide you with limited options for personalizing the address of your website, since most dynamic DNS companies will only allow you to customize the 'server' part of the address they give you. For example, you might be presented with '*****.sytes.net' and be allowed to customize the asterisked portion.

Fortunately, most domain registration services allow you to redirect your registered DNS name to another DNS name. This means you can register the domain name of your choice then redirect it to your yourwebsite.sytes.net dynamic DNS address, which then redirects visitors to your constantly updated IP address. Neat.

To set this up, you'll first have to register with a dynamic DNS provider. Some of the more popular free dynamic DNS sites are DynDNS.org and No-IP.com, but there are many, many more. Here's a list to get you started.

In most cases, the dynamic DNS provider will lead you through the process of setting up dynamic DNS, which includes choosing a domain name from the provider and downloading and installing their client software. There are several other options that dynamic DNS providers may offer, such as aliases (which allow you to map multiple domain names to your computer's IP address) and MX records for email, but we're not going to cover these in detail in this guide.

Once the dynamic DNS is all set up, test it by opening up a web browser and entering the domain name you got from the dynamic DNS provider. Provided your web site is up and running in IIS, you will now be seeing your website from across the Internet.

Now all you have to do is ensure that the dynamic DNS update program you downloaded from the provider is running at all times, and anyone will be able to access your website from the Internet.

Hosting a website on a static IP Internet connection

Note: Many Internet Service Providers that provide static IP addresses to their customers do not allow website hosting over these connections unless the customer opts for a specialized account. In our experience, personal websites often get overlooked when it comes to these regulations, but to be safe, check up on your provider's policies before you proceed further.

Provided your ISP allows it, hosting a website on a static IP connection is extremely easy. All you need to do is either register a domain (as covered above) and provide your static IP address as the target for the domain, or simply use your static IP address as a means to get to your web page.

If your IP should eventually change for some reason, simply updating your domain name with the new information or using the new IP address in your browser will suffice.

Using Dynamic DNS services to acquire a domain name for a static IP

If you read the section above on dealing with dynamic IP addresses, you will have noted that dynamic DNS services all provide you with a domain name by default. You can take advantage of this even if you have a static IP address. Sign up for the service, create your domain name and link it with your home PCs static IP address, either through the service's downloadable client or directly on their website. Presto, you have a domain name that people can type into a browser to reach your website.

Finally! Your own website.

If you've followed the above instructions carefully, you should be able to enter the domain name or IP address of your web server in any browser and be greeted with your brand new website. Congratulations! You now know enough to start delving deeper into the mysteries of IIS configuration. The IIS control panel can be accessed by right clicking 'my computer' and selecting 'manage', then expanding 'services and applications' and clicking on 'Internet Information Service'.

There are many, many control options here, which are beyond the scope of this article, but which we may delve deeper into in later guides. If you have any comments or questions, please post them in the PCSTATSForums or drop us a line at the Feeback page.

Understanding IP Addresses

IP (Internet Protocol) addresses are the backbone of computer networking, both on the Internet and in your home network. They are the 'phone numbers' that allow computers to locate and communicate with each other across networks.

An IP Address is made up of 4 sets of decimal numbers, 0-255, separated by periods (for example, 192.168.44.251) which form the address of a computer on the Internet or within a local network, and allow it to be referenced by other computers.

In order to view a website, or to allow others to view your website, your computer must have a valid Internet IP address in order to exchange data with a web server or the potential readers of your website.

Your Internet Service Provider allocates your home PC a valid Internet IP address when it connects to the Internet. Depending on the provider, this IP address may stay the same for long periods (static IP) or may change frequently (dynamic IP).

A computer can have multiple IP addresses assigned to it. If your computer connects both to the Internet via your provider's cable/DSL modem and to a home network, you will have a separate IP address for each connection.

To view your IP address information, go to 'start\run' and type 'cmd' to bring up the command prompt, then type 'ipconfig'. This will list all the IP addresses your computer is currently using. If you use a home router or other Internet sharing device, check its status page to find out your Internet IP address. If you are not sure how to do this, consult the manual for the device

How do I host my own website at home?

You can host your own website at home, and I'll tell you exactly how! But it might not save you much money, and it definitely won't save you time. So give it serious thought before you proceed... unless your goal is simply to learn about the technology and have fun!

The best reason to host your website at home is to learn how it all works. For more information about the pros and cons, see should I host my own website?

Warning: running a server of any kind at home is a security risk. Security problems are sometimes found in server software, and these can be exploited to gain access to or damage your files. Your computer must be kept absolutely up to date with Windows Update or the equivalent for your operating system if you intend to run a web server on it. If you choose to run Apache instead of Internet Information Server, you'll need to keep your version of Apache absolutely up to date too. This doesn't eliminate the risk -- it only minimizes it. You run a server at home entirely at your own risk. If you do choose to run a server at home, I recommend finding an old PC on the curb and setting it up as your home server, reducing the danger to your own computer.


Here are the steps to follow to set up a website hosted entirely on your own Windows PC. First I'll present the general steps, then I'll break down the details for you:

1. Make sure you have cable modem, DSL or another high-speed connection. A dialup telephone modem is NOT good enough.

2. Get a DNS hostname for your home Internet connection.

3. Get a static local IP address for your computer within your home network.

4. Configure your router to correctly forward connections on port 80 (the HTTPport) to your web server. Even if you think you don't have a router, you probably do— many popular cable and DSL modems include wifi or wired Ethernet jacks for multiple computers, which means they contain a built-in router. If your ISP blocks port 80, choose an alternative port number and forward that (or get a better ISP that welcomes websites at home, like Speakeasy.Net).

5. Configure Windows Firewall to allow your web server to communicate on port 80.

6. Get Apache, a free, high-quality web server program. If you have Windows XP Professional, you also have the option of Microsoft Internet Information Server (IIS), which comes standard with Windows XP Professional. But that option only allows you to host one site. I recommend Apache.

7. Test your web server from your own computer.

8. Replace the default home page with your own web page. Now the site is your own!

9. Test your web server from a computer that is NOT on your home network to make sure you followed all of the steps correctly.


Beginners Guides: Website Hosting From A Home PC

Obstacles like IIS and dynamic IP addresses can make the process of running a website off a home broadband internet connection complicated... There are several tricks you'll need to know to get it working, so follow along and get clicking! - Version 1.0.0


Websites are still cool. It doesn't matter how many badly designed personal sites there are out there with questionable flash animations and animated GIFs abounding; the fact is that a website still offers you almost unlimited room for personal expression, with the added side-bonus of potentially being useful.

If you want a website badly enough, there are many service providers that will be only too willing to design the site for you, then host it on one of their servers

for a monthly fee. If you have the cash, you can have a website of your own quickly and easily.

But what if you have the ideas but not the cash? Why pay someone else to host your website for you when you can easily do it yourself on the home computer over a broadband Internet connection?

In this guide, PCSTATS will explore the process of hosting a website from your home computer using a broadband Internet connection. For the sake of simplicity, we'll stick to using Microsoft's IIS (Internet Information Server) to render the site, and help you deal with the issues of dynamic IP addresses, among other potential home-based web hosting problems.

We'll leave the details of creating your own HTML website up to you. There are plenty of freely available programs that can help you do this, and of course you can always just use Notepad to code up the HTML by hand, so no excuses. We're only interested in the hard parts of hosting a website from a home PC!

Note: Since this PCSTATS beginner's guide only covers using Microsoft's IIS application to host websites, users of Windows XP Home edition or Windows 98SE/ME are out of luck. Unfortunately, IIS is not included with these operating systems. We may produce a guide on using a third-party web hosting program like Apache later on, depending on reader interest. For the purposes of this guide,Windows NT/2000/XP Professional will all work.

Before we get going, we need to get familiar with a few basic concepts, namely DNS (Domain Name System) and IP (Internet Protocol) addresses and how they are used when hosting a website. The following descriptions are slightly (or not so slightly) simplified, but they will suffice for our objective.