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.
Tags:
IPV6