SmithIT.co.uk SmithIT.co.uk
SmithIT.co.uk

Your IP Address And Name Resolution

Your IP Address is a number that identifies you so that other addresses on an inter network know where to send data to get it to you or get to a service you provide. The number that represents the IP Address may not initially make sense but the basics are pretty straight forward, although things can start to get very complicated the deeper you dig. However for a simple home network the basics will do fine. While reading this page it may be worth referencing the page on TCP/IP Tools.

What Is An IP Address Made Of?
IP Address

Your IP Address is made of four numbers between 0 and 255 all separated by dots. For example 192.168.2.43. It is a number that differentiates you from all other hosts on the network so that one host knows where to send data for another host.

These numbers are between 0 and 255 for a simple reason. As computers count in Binary, the version of IP in general use today, IPv4, addresses hosts by using 32 Binary bits. However a Binary number, 32 characters long is not that easy to manage so splitting up the 32 bits into 4 groups of 8 bits, called a Binary Octet, makes things easier to work with. So if the Binary Octet can be anything between 00000000 and 11111111, this makes decimal values of between 0 and 255.

Subnet Mask

Subnetting can be quite a tricky subject but in basic home networking it can be kept very straight forward. A Subnet Mask looks similar to an IP Address, with 4 Binary Octets. The difference between the IP Address and the Subnet Mask is that usually the Subnet Mask will be 0 or 255, or 00000000 and 11111111 in Binary. What this number shows is which part of the IP Address is the Network address and which part of the IP Address is the Host address, the 1's represent the network part of the address and the 0's represent the host part of the address. For example: -

IP Address : 192.168.2.1


Subnet Mask : 255.255.0.0

(or 11111111 11111111 00000000 00000000)

As you can see the first two numbers in the Subnet Mask are 255. Because this means that the first 16 bits of the Subnet Mask are all 1, this tells us that the first 16 bits of the IP Address are the network address (192.168) and the last 16 bits of the IP Address are the host address (2.1). If the Subnet Mask for the above example was 255.255.255.0 then the network address would be 192.168.2 and the host address would be 1.

IP Address Range

The IP Address Range is the addresses that are valid to be used on the network. So the network in the above example would be written as 192.168.0.0 as it's subnet mask is 255.255.0.0. This would mean that as the host addresses use all of the last 16 bits, the range of valid IP Addresses for the network is 192.168.0.1 to 192.168.255.254. The last address (192.168.255.255 in our example) can not be used as a valid IP Address as it is used for broadcasting IP packets (sending packets to all hosts in the network).

Sometimes you may see the IP Address in the above example written as 192.168.2.1/16. These two ways of writing the IP address mean exactly the same thing as the 16 on the end means the first 16 bits are the network address.

Why is the IP Address Range important? This is because if you want to network all of your computers to be able to talk to each other you must make sure that they are all on the same network, so their network address must be the same. If you had a computer with an IP Address of 192.168.2.5 and a Subnet Mask of 255.0.0.0 connected to the computer in the above example they would not communicate as 1 has a network address of 192.168 and the other has a network address of 192.

Public or Private Address?

There are two main categories of IP Addresses. There are Public IP Addresses and Private Addresses.

Public IP Addresses

Public Addresses are just that, they are addresses that can be seen by the public, i.e. they are addresses that can be used over the Internet to access another host. IANA (Internet Assigned Numbers Authority) are responsible for providing large blocks of valid Public IP Addresses to regional suppliers, who in turn provide smaller blocks to ISP's and large companies for use or resale.

If you wish to access resources on the Internet you must have a valid public IP address, which is normally assigned to the modem or router automatically when you initiate your Internet connection by signing in to your ISP.

Private IP Addresses

Private IP Addresses are addresses that have been specifically set aside, which do not get seen by the Internet and are used for internal (non Internet facing) networks. The reason these addresses were set aside is because many private networks do not need access to the Internet or they need to be kept private from the Internet. Using these addresses which can not be seen directly on the Internet makes it possible to either keep your network private or allow you to centrally administer access for the entire network through some kind of router. Setting these addresses aside also allows all private networks to use the same range of network addresses, which saves using valuable Public IP Addresses as there is only a finite number of public addresses available.

The IP Addresses which have been set aside for Private networks are: -

Network Address : 10.0.0.0

Subnet Mask : 255.0.0.0

1st IP Address : 10.0.0.1

Last IP Address : 10.255.255.254

Broadcast Address : 10.255.255.255


Network Address : 172.16.0.0

Subnet Mask : 255.240.0.0

1st IP Address : 172.16.0.1

Last IP Address : 172.31.255.254

Broadcast Address : 172.31.255.255


Network Address : 192.168.0.0

Subnet Mask : 255.255.0.0

1st IP Address : 192.168.0.1

Last IP Address : 192.168.255.254

Broadcast Address : 192.168.255.255



How Do I Get My IP Address?

You get your IP Address one of three ways. Either it is manually set, the computer sets it's own or your computer receives an Address from a service called DHCP (Dynamic Host Configuration protocol).

Manually Set IP Address

A manually set IP Address is an address that is configured on your network card. It will not change unless it is specifically reset to a different Address or set to obtain an Address automatically. To check if your IP Address is manually configured Open a command Prompt and type ipconfig /all, if your IP Address is manually set you will see a line saying: -

Dhcp Enabled...........: No

You can set the IP Address manually by opening Network Connections, right clicking on the network card that you want to assign an address to and selecting Properties. When the Network Card Properties window opens double click Internet Protocol (TCP / IP) in the central box and a window will open similar to the one below: -

Internet Protocol (TCP/IP) Properties showing a manually set IP Address
Internet Protocol (TCP/IP) Properties showing a Manually set IP Address.

(Note : The Default Gateway and Primary DNS Server have also been manually set)

Manually setting your IP Address is fine if your network stays the same and never changes. You should have manually set IP Addresses on certain servers and routers, which usually hold the first addresses in the network range. However if you have a very large network or your computers are being moved around your network, keeping track of every computers address can become complex. In this circumstance most networks use a service called Dynamic Host Configuration Protocol (DHCP).

Automatically Set IP Address by the computer (APIPA)

APIPA or Automatic Private IP Addressing is where your computer is set to obtain and IP Address automatically but there is no DHCP server present to issue an address. In this situation APIPA kicks in and the computer sets the IP Address itself. Before doing this it would have already sent out a message on the local network looking for a DHCP server. When one is not found APIPA chooses an address from a network range, that has been specifically set aside for this purpose, and sends a message to the local network asking if anybody is currently using this address. If another host is using this address the computer chooses a different address and again asks on the network if the next address is being used. When an address is found that is not being used on the local network the computer assigns this address to the network card.

You can tell an APIPA set IP Address a number of ways. The most obvious is the address itself. If you see a network address that begins 169.254.x.x you can be pretty sure there is no DHCP server on the network and APIPA has set the IP address. The Address range set aside for APIPA is: -

Network Address : 169.254.0.0

Subnet Mask : 255.255.0.0

1st IP Address : 169.254.0.1

Last IP Address : 169.254.255.254

Broadcast Address : 169.254.255.255


You will also be able to see an APIPA set IP address by opening a command prompt and typing ipconfig /all. This time again you will see that the DHCP setting is enabled even though the address has not been issued by a DHCP server. If you look at the example below, which shows the ipconfig /all output for an APIPA set IP Address, you can see that there is no line which states which host is the DHCP server. As the address is not manually set, which we can tell because Autoconfiguration is enabled, we know that the address has been set by APIPA.

IPconfig showing APIPA set IP Address
IPconfig showing an APIPA set IP Address

(Note : The there is no DHCP SERVER line)

Again, you can also see exactly the same results by looking at the Details on the Support tab in the network card Status window. This will look something like the next picture.

Network card Status showing APIPA set IP Address
IPconfig showing an APIPA set IP Address

(Note : The there is no DHCP SERVER line)

Limited Connectivity System Tray Icon

When using Windows XP if the IP Address has been set by APIPA you will see a little exclamation mark on the network icon in the system tray like the one to the right. You may also see a bubble appear from it saying that you only have limited connectivity. This is because APIPA addresses are not routable. This means that they can not access any network outside of it's range even through a router. It also has other limitations which are OK if you just need to share files or a printer between a couple of computer at home but if more advanced setting are needed then you will not be able to achieve many of them with APIPA.

DHCP, Automatically Set IP Address

DHCP is the Dynamic Host Configuration Protocol. The Dynamic Host Configuration Protocol is a service which issues IP Addresses to hosts that are set up to Obtain an IP Address automatically. DHCP servers can be either software based and come with Operating Systems like Windows Server 2003 or as stand alone applications or they can come hardware based where they are written into firmware, for example in routers.

DHCP servers are used as an easy way to make sure all of your hosts have valid IP Addresses for the subnet (local group of computers) that they are connected to. When a network connection is set to Obtain an address automatically it looks to see if it can contact a DHCP server on the network when it boots. If it can contact a DHCP server it will ask the DHCP server if it can continue using it's previously assigned address if it has one or if it is contacting the server for the first time it will ask for a new address. The DHCP server will then say yes, continue using your old address if it has not already re-assigned it's previous address. If it has re-assigned the previous address or if the network card is requesting an address for the first time the DHCP server will issue a new IP Addresses out of a pool of addresses which it knows it has not already issued.

This pool of IP Addresses will have been set with a range of IP Addresses that are valid for the subnets which the DHCP server serves. This means that you should not need to worry about two hosts having the same IP Address and you do not need to remember which IP Addresses you have already set when setting up new computers as you do in a manually set IP Address configuration. Also you can easily move computers between subnets and the address will be reset according to the subnet it is put on.

To get your network card in the computer to obtain an IP Address automatically you just need to select that option in the Internet Protocol (TCP/IP) Properties, which is shown in an example above. To see if your IP Address has been set by a DHCP server you can open a command prompt and type ipconfig /all. If your IP Address has been issued by a DHCP server you will see an output similar to the one shown below.

IPconfig showing DHCP set IP Address
IPconfig showing a DHCP set IP Address

(Note : The line stating - DHCP Server........: 10.0.11.20 )

In the above example you can see an entry for a DHCP server, which in this case is 10.0.11.20. What this tells us is that a DHCP server, who's own network address is 10.0.11.20, has issued the address for this network card. Although there is also a line which shows that DHCP is enabled this does not necessarily mean that the IP Address being used has been issued by a DHCP server, it just means that the card has this feature enabled if a DHCP server should be available. You can also see this by opening Network Connections, right clicking on the network card that you to check and selecting Status. When the Network cards Status window opens select the Support tab and click on Details. This will show you a window like below.

Network card Status showing DHCP set IP Address
Network card Status window showing a DHCP set IP Address

(Note : The line stating - DHCP Server       10.0.11.20)

DHCP can be provided by either software methods, e.g. Windows 2000 server or ICS (Internet Connection Sharing) or they can be built in to certain hardware devices, e.g. dedicated DHCP servers or routers etc... Usually the ADSL routers that are given away by ISP's and the Wireless Access Points sold in the shops have in built DHCP servers, just check documentation before buying to check. Setting them up is usually as simple as specifying a range of addresses you want the server to issue from and enabling the server. A DHCP server can also be used to assign addresses to the network card that point it to a Default Gateway, DNS servers , WINS servers and so on. In the example shown above you can see that the DHCP server has also issued these address pointers to the network card.


What Is DNS?

DNS is the Domain Name System. It is a system that is used to give computers a unique name that can be used to access it's resources. DNS is the system used on the Internet and most computer networks to resolve computer names to IP Addresses. In basic terms the easiest way of describing the Domain Name System is a dynamic address book for hosts.

Because computers communicate with each other using a numbered IP Addressing scheme computer operators need a way to be able to remember the addresses of the hosts that they access on a regular basis. Because it would be quite difficult to remember lots of different IP Addresses and us humans find it easier to remember names a hierarchical naming system was created, DNS, which could map a specific host name called a URL, or Uniform Resource Locator (e.g. www.SmithIT.co.uk), to it's IP Address (e.g. 212.227.124.7).

So when you open your Internet browser and type in a web site address (URL) into the address bar (e.g. www.SmithIT.co.uk) the computer has no idea where to send data for this host because it's addressing and data routing scheme is based on the numbered IP Address. To be able to resolve the URL to an IP Address the computer will have to try to find the IP Address number which corresponds to this web site name. To do this it will first check in a table held in memory of previously visited web site. If it has visited the site before it will know the IP Address of the site and send data to this address.

If there is no entry in this table it will have to ask if anybody knows which IP Address hosts this URL. The service that it will query is the DNS service. The computer will only be able to contact a DNS server if it has either been manually set or if a DHCP server has issued a pointer to the local DNS server. Usually, if you are using an ADSL router the DHCP server will point the computer to the ADSL router for DNS queries as they will have a DNS server written into the firmware. If your computer can not contact a DNS server it will not have it's query answered and will not be able to contact the web site in question.

If you send a query to a DNS server and it knows the IP Address for the URL the DNS server will send a response back to your computer with the IP Address you require. Now your computer has the IP Address of the host computer for the URL you are trying to communicate with, your computer can open a session with that host and start to send and receive data to and from it.

If the computer queries a DNS server for an address and the DNS server does not know the IP address for the query, it will then usually be passed on to another DNS server. As the naming scheme on the Internet is hierarchical there are a number of servers called root servers which, if your Primary DNS server (the DNS server your computer will try to contact first) does not know the IP Address itself, it will know where to pass the query for the correct response. In the end your computer will end up at a DNS server who is responsible for the domain you are trying to contact and will be able to provide your computer with the IP Address you are looking for. You will then be able to start your session with the host you are trying to communicate with.

Your Primary and Secondary DNS servers can be manually set in the same process used to manually set your IP Address or you can set up a DHCP server to provide the address of any Primary and Secondary DNS servers when if it automatically sets your computers IP Address. If you change the address of DNS server that the DHCP server should provide to clients you would need to run the ipconfig /renew command from a command prompt on the clients which would renew the IP Address information from the DHCP server which would also set the new DNS servers settings on the client.

If you feel anything on this site is misrepresented or inaccurate please let me know.

Thank You to those that already have, your input is appreciated and most welcome.