github.com/jenkins-x/jx/v2@v2.1.155/cmd/ip/ip.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"net"
     6  )
     7  
     8  func main() {
     9  	//host := "a79adab7027a111e8b6e502c017ed5f7-1934607766.eu-west-1.elb.amazonaws.com"
    10  	host := "google.com"
    11  
    12  	ips, err := net.LookupIP(host)
    13  	if err != nil {
    14  		fmt.Printf("Failed: %s\n", err)
    15  		return
    16  	}
    17  
    18  	for _, ip := range ips {
    19  		fmt.Printf("IP: %s\n", ip.String())
    20  	}
    21  
    22  	fmt.Println("Done!")
    23  }