Search…
Host
The host name part of the URL is, of course, simply a name that can be resolved to an numerical IP address, or the numerical address itself.
1
curl http://example.com
Copied!
When specifying a numerical address, use the dotted version for IPv4 addresses:
1
curl http://127.0.0.1/
Copied!
…and for IPv6 addresses the numerical version needs to be within square brackets:
1
curl http://[2a04:4e42::561]/
Copied!
When a host name is used, the converting of the name to an IP address is typically done using the system's resolver functions. That normally lets a sysadmin provide local name lookups in the /etc/hosts file (or equivalent).

International Domain Names (IDN)

curl knows how to deal with IDN names and you just pass them on like you would a normal name:
1
curl https://räksmörgås.se
Copied!
Export as PDF
Copy link
Edit on GitHub