Computer Networks

[Day 6] 5. Configuring Hosts

D
DITISS Admin
••3 min read

Static IP Host Mapping:

Static host configuration allows you to assign names to IP addresses, making it easier to telnet to those routers by name rather than using IPs.

  • Command:
    A(config)# ip host B 172.16.20.2 
    A(config)# ip host C 170.16.40.2
  • Explanation:
    • This command maps the name (e.g., B, C) to the respective IP address (e.g., 172.16.20.2).
    • Limitations: You can configure up to 8 static hosts using this method.
    • This is useful to remember the IPs of frequently accessed routers.

Dynamic IP Host Mapping Using DNS

Dynamic IP host mapping allows routers to use a DNS server to resolve hostnames to IP addresses, eliminating the need for manual configuration on hosts.

Default Behavior

By default, most modern network devices have DNS resolution enabled (e.g., the

ip domain-lookup
command in IOS 11.3+).

Problem:

  • If a DNS server is not configured, mistyping a command or hostname can cause the device to repeatedly broadcast and attempt to resolve the name to
    255.255.255.255
    (broadcast address), leading to delays.

Solution:

  • Disable DNS lookups if a DNS server is not configured to prevent unnecessary broadcast attempts:

    A(config)# no ip domain-lookup  
    
Configuring DNS
  1. Specify the DNS Server IP Address:
    Set the IP address of the DNS server that the device will use for name resolution:

    A(config)# ip name-server <DNS_Server_IP>  
    

    Example:

    A(config)# ip name-server 172.16.50.100  
    
  2. Name Resolution in Action:

    • When a hostname (e.g.,
      b.sunbeam.com
      ) is entered:
      • The device sends a DNS query to the configured server.
      • If the DNS server resolves the hostname, the device uses the returned IP address to connect.

    Example Usage:

    A# b.sunbeam.com  
    
    • The device queries the DNS server and establishes a connection once the IP address is resolved.
Domain Name Shortcuts

To simplify hostname entries, you can configure a default domain name:

A(config)# ip domain-name <domain_name>  

Example:

A(config)# ip domain-name sunbeam.com  

After setting a default domain name, you can use shortcuts for DNS lookups. Instead of typing the full hostname, you can just use the hostname:

A# b  

The device appends the default domain (

sunbeam.com
) to the hostname (
b
), automatically resolving it to
b.sunbeam.com
.


Summary:

  • Static: Use
    ip host
    to manually configure up to 8 hostnames with their IP addresses.
  • Dynamic: Use a DNS server to dynamically resolve hostnames to IPs using
    ip name-server
    and domain name configuration.
  • To avoid unnecessary DNS lookups when DNS is not configured, use
    no ip domain-lookup
    .

Read Next

8/26/2026

[Day 6] 6. Routing

### **Routing Overview**: Routing is the process of selecting the best path for data packets to travel from one network to another to reach their d...

8/26/2026

[Day 6] 7. Static and Default Routing

### **Static Routing** Static routing involves manually specifying routes in the routing table. - **Command**: ``` A(config)# ip...