Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert an url to an IP address

Tags:

raku

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.

like image 404
7hsk Avatar asked May 31 '18 10:05

7hsk


People also ask

Can a URL be an IP address?

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.

Which of the following is used to convert URL into IP address?

DNS: The Magic that Translates Website Names into IP Addresses.

How do I find my IP address instead of URL?

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.


1 Answers

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.

like image 56
jjmerelo Avatar answered Jan 02 '23 23:01

jjmerelo