함수 gethostbyname()


개요

함수 getgostbyname()

Go

package main

import (
	"fmt"
	"net"
)

func main() {
	ips, _ := net.LookupHost("example.com")
	fmt.Println(ips)
}

PHP

$ip = gethostbyname('example.com');
echo $ip;

Python

import socket
ip = socket.gethostbyname('example.com')
print(ip)