Prompt Detail:
To make curl
only use IPv4, you can add the -4
or --ipv4
option in your .curlrc
file. The .curlrc
file is typically located in your home directory (~/.curlrc
).
Here's how you can add the option to your .curlrc
file:
Open a terminal.
Use a text editor to open or create the
.curlrc
file in your home directory. You can use a command likenano
orvi
. For example:bashnano ~/.curlrc
Add the following line to the
.curlrc
file:diff-4
This line tells
curl
to use IPv4 only.Save the file and exit the text editor.
Now, curl
will always use IPv4 when making requests unless you specify a different option on the command line, such as --ipv6
to force IPv6 usage for a specific request.