31.1 Host Name to IP Address Mapping

   

31.1 Host Name to IP Address Mapping

Hosts on an IP network are recognized by their IP addresses. On large-scale IP networks like the Internet, it is difficult for a user to remember IP addresses of different servers. The solution is to assign easy-to-remember host names to them. User applications use these host names for network communication. However, network traffic uses IP addresses instead of these host names. Before starting a network communication process, a computer must map a host name to an IP address. The process of mapping host names to IP addresses is called name resolution. Once a name is resolved to its IP address, communication can start in its usual way. The name resolution process works in two ways.

  • Find an IP address when given a host name.

  • Find a host name when given an IP address. This is also called reverse name resolution.

The first type of resolution is performed through the gethostbyname() function, while the second type of resolution is performed through the gethostbyadd() library function. These functions are used in application programs and are collectively called resolver library functions or simply resolver.

Multiple Host Names for a Single IP

Host name aliases or canonical names can be used such that a single IP address is known by multiple host names. This situation arises when multiple services are running on a single host, and you want to use a separate name for each service. For example, if a single machine is serving as FTP, Web, and mail server, you may want to access the Web server with the name www.mydomain.com , the FTP server using the name ftp.mydomain.com , and the mail server using mail.mydomain.com .

A single host may also serve multiple domain names. For example, the Web hosting services on the Internet use one server for hosting Web pages for many companies. A separate host name is used for each company. Theoretically, you can map one IP address to as many host names as you want.

Multiple IP Addresses for a Single Host

As a reverse of the above-mentioned process, sometimes it is required that multiple IP addresses are used for the same host name. This is done for load-sharing purposes. For example, if a Web server is heavily loaded, multiple hosts can be assigned the same name but different IP addresses. In such a case, the load is evenly distributed among these servers. This is true only when you are using DNS as the name resolution method.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net