How to avoid curl trying IPv6 name resolution

 To make `curl` avoid IPv6 name resolution and only use IPv4, you can use the `-4` or `--ipv4` option. This forces `curl` to resolve hostnames to IPv4 addresses. Here's how you can use it:


```bash

curl -4 -O http://example.com/file.txt

```


Alternatively, you can use `--ipv4` instead of `-4`:


```bash

curl --ipv4 -O http://example.com/file.txt

```


This will ensure that `curl` only attempts to resolve the hostname to an IPv4 address and not IPv6.

Comments

Popular posts from this blog

bad character U+002D '-' in my helm template

GitLab pipeline stopped working with invalid yaml error

How do I add a printer in OpenSUSE which is being shared by a CUPS print server?