[Day 6] 5. Configuring Hosts
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.2A(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-lookupProblem:
- 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 (broadcast address), leading to delays.
255.255.255.255
Solution:
-
Disable DNS lookups if a DNS server is not configured to prevent unnecessary broadcast attempts:
A(config)# no ip domain-lookup
Configuring DNS
-
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 -
Name Resolution in Action:
- When a hostname (e.g., ) is entered:
b.sunbeam.com- 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.
- When a hostname (e.g.,
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.combb.sunbeam.comSummary:
- Static: Use to manually configure up to 8 hostnames with their IP addresses.
ip host - Dynamic: Use a DNS server to dynamically resolve hostnames to IPs using and domain name configuration.
ip name-server - To avoid unnecessary DNS lookups when DNS is not configured, use .
no ip domain-lookup
Read Next
[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...
[Day 6] 7. Static and Default Routing
### **Static Routing** Static routing involves manually specifying routes in the routing table. - **Command**: ``` A(config)# ip...