6) Hostname configuration




HOST NAME CONFIGURATION
_________________________________________________________________________________________________________________________________________________




v Stub resolver
    The stub resolver is used to resolver host name into IP address and reserve. By default, the contents of the /etc/hostname file are checked first.
    §  Default location
              /etc/hostname

    §  To check Hostname
#        Hostnamectl
       or
#        hostnamectl status

v Types of Host name
    §  Static Hostname
    §  Dynamic Hostname
    §  Pretty Hostname

    §  Static Hostname:- Assigned by system admin. For example, srv1, srv2, srv.mysolution.com.
    §  Dynamic Hostname:- Assigned by DHCP.
    §  Pretty Hostname:- Assigned by system admin / end–users and it is a free form UTFB hostname for presentation to the user. For example, “Jetking PC”.

v How can we set the Hostname.
#        hostnamectl ɸ set-hostname ɸ (your new hostname here)
#        hostnamectl ɸ set-hostname ɸ(your new hostname here)ɸ - pretty
#        hostnamectl ɸ set-hostname ɸ (your new hostname here) ɸ - static
#        hostnamectl ɸ set-hostname ɸ (your new hostname here) ɸ - - transient

v How can remove Hostname.
#        hostnamectl ɸ set-hostname ɸ ɸ - pretty
#        hostnamectl ɸ set-hostname ɸ ɸ - static
#        hostnamectl ɸ set-hostname ɸ ɸ - - transient

v How to change Hostname remotely.
#        ssh ɸ root@ (server ip) ɸ hostnamectl ɸ set-hostname ɸ SRV1
                                               or
#        hostnamectl ɸ set-hostname ɸ SRV2 ɸ –H ɸ root@ (user ip)

v To check mac-address and interface name.
#        ip ɸ link

v To check ip address and network for all interfaces.
                 #        ip ɸ addr
                 #        if ɸ ifconfig

v Tracing routes taken by Traffic.
traceroute or tracepath is a command line tool to check path between source host to destination host.
    §  For IPv4
#        tracepath ɸ google.com
    §  For IPv6
#        tracepath6 ɸ 2001:db8:0:2:451

Comments