resolve.md (1860B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Long: resolve 5 Arg: <[+]host:port:addr[,addr]...> 6 Help: Resolve host+port to address 7 Added: 7.21.3 8 Category: connection dns 9 Multi: append 10 See-also: 11 - connect-to 12 - alt-svc 13 Example: 14 - --resolve example.com:443:127.0.0.1 $URL 15 - --resolve example.com:443:[2001:db8::252f:efd6] $URL 16 --- 17 18 # `--resolve` 19 20 Provide a custom address for a specific host and port pair. Using this, you 21 can make the curl requests(s) use a specified address and prevent the 22 otherwise normally resolved address to be used. Consider it a sort of 23 /etc/hosts alternative provided on the command line. The port number should be 24 the number used for the specific protocol the host is used for. It means you 25 need several entries if you want to provide addresses for the same host but 26 different ports. 27 28 By specifying `*` as host you can tell curl to resolve any host and specific 29 port pair to the specified address. Wildcard is resolved last so any --resolve 30 with a specific host and port is used first. 31 32 The provided address set by this option is used even if --ipv4 or --ipv6 is 33 set to make curl use another IP version. 34 35 By prefixing the host with a '+' you can make the entry time out after curl's 36 default timeout (1 minute). Note that this only makes sense for long running 37 parallel transfers with a lot of files. In such cases, if this option is used 38 curl tries to resolve the host as it normally would once the timeout has 39 expired. 40 41 Provide IPv6 addresses within [brackets]. 42 43 To redirect connects from a specific hostname or any hostname, independently 44 of port number, consider the --connect-to option. 45 46 Support for resolving with wildcard was added in 7.64.0. 47 48 Support for the '+' prefix was added in 7.75.0. 49 50 Support for specifying the host component as an IPv6 address was added in 8.13.0.