Tutorial by Examples

Ifconfig List all the interfaces available on the machine $ ifconfig -a List the details of a specific interface Syntax: $ ifconfig <interface> Example: $ ifconfig eth0 eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx inet addr:x.x.x.x Bcast:x.x.x.x Mask:x.x.x.x ...
An IP address to an interface could be obtained via DHCP or Static assignment DHCP If you are connected to a network with a DHCP server running, dhclient command can get an IP address for your interface $ dhclient <interface> or alternatively, you could make a change to the /etc/network/...
File: /etc/hosts contains a list of hosts that are to be resolved locally(not by DNS) Sample contents of the file: 127.0.0.1 your-node-name.your-domain.com localhost.localdomain localhost XXX.XXX.XXX.XXX node-name The file format for the hosts file is specified by RFC 952
File: /etc/resolv.conf contains a list of DNS servers for domain name resolution Sample contents of the file: nameserver 8.8.8.8 # IP address of the primary name server nameserver 8.8.4.4 # IP address of the secondary name server In case internal DNS server you can validate if this server reso...
Manipulate the IP routing table using route Display routing table $ route # Displays list or routes and also resolves host names $ route -n # Displays list of routes without resolving host names for faster results Add/Delete route OptionDescriptionadd or delAdd or delete a route-host x.x.x.xA...
You can configure your Linux (or macOS) system in order to tie in an identifier <hostname> to some other system's IP address in your network. You can configure it: Systemwide. You should modify the /etc/hosts file. You just have to add to that file a new line containing: the remote sys...

Page 1 of 1