but when I use host the computer is able to know the host.
[root@localhost ~]# host unix.com
unix.com has address 81.17.242.186
unix.com mail is handled by 10 aspmx2.googlemail.com.
unix.com mail is handled by 10 aspmx3.googlemail.com.
unix.com mail is handled by 10 aspmx4.googlemail.com.
unix.com mail is handled by 10 aspmx5.googlemail.com.
unix.com mail is handled by 1 aspmx.l.google.com.
unix.com mail is handled by 5 alt1.aspmx.l.google.com.
unix.com mail is handled by 5 alt2.aspmx.l.google.com.
what is the reason?
why the ping can not recognize the host but the host command can?
argument of inet, IPv4 is used. For inet6, IPv6 is used.
By default, if the name of a host is provided,not the literal IP address, and a valid IPv6 address exists in the name service database, ping will use this address. Otherwise, if the name service database contains an IPv4 address, it will try the IPv4 address.
Specify the address family inet or inet6 to override the default behavior. If the argument specified is inet, ping will use the IPv4 address associated with the host name. If none exists, ping will state that the host is unknown and exit. It does not try to determine if an IPv6 address exists in the name service database.
If the specified argument is inet6, ping uses the IPv6 address that is associated with the host name. If none exists, ping states that the host is unknown and exits.