Finding the IP address of a domain

后端 未结 6 619
别那么骄傲
别那么骄傲 2021-01-04 01:52

How can I find the IP address of an arbitrary domain? I want to get the IP address from the DNS server.

6条回答
  •  感情败类
    2021-01-04 02:11

    Try going through the shell

    domain = "google.com"
    `host #{domain}`.match(/(\d{1,3}\.){3}\d{1,3}/).to_s
    #=> "74.125.39.99"
    

提交回复
热议问题