Find IP address from hostname
Looking up an IP address from a host name is called "forward DNS lookup".
This process can be done by making a query to the name server (DNS) to receive IP address information.
●Use the dig command to find out the IP address.
Try to find the IP address of the Yahoo hostname "https://www.yahoo.co.jp/".
Check the ANSWER SECTION of the execution result, and you will see the IP address of "https://www.yahoo.co.jp/".
[root@Lion ~]# dig www.yahoo.co.jp
; <<>> DiG 9.9.4-RedHat-9.9.4-72.el7 <<>> yahoo.co.jp ;; OPT PSEUDOSECTION: ;; ANSWER SECTION: ;; Query time: 4 msec |
Note that the ";; SERVER: 192.168.11.1#53(192.168.11.1)" part in the above result is the IP address of the cache DNS server specified in
IP address of the cache DNS server specified in /etc/resolv.conf.
●Simplified view.(+short option)
ヤフーのhttps://www.yahoo.co.jp/というホスト名のIPアドレスを求めてみます。
[root@Lion ~]# dig www.yahoo.co.jp +short
82.22.25.252 |