Right now I'm learning the Perl 6 language, and I'd like to know how to convert an url to an IP address
It seems to me that the gethostbyname function does not exist.
No. An IP address is a unique number assigned to each device on a network. A domain name is assigned a unique IP address on the World Wide Web.
DNS: The Magic that Translates Website Names into IP Addresses.
To use an IP address instead of a domain name, simply enter the IP address in the URL in place of the domain name. For example, the URL http://192.168.1.1/index.html would take you to the same page as http://www.pcwebopedia.com/index.html.
gethostbyname is obsoleted by now. getaddrinfo
is used instead. You will have to use the NativeCall API to call this POSIX function. The example included in the NativeCall page addresses precisely this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With