mirror of https://github.com/docker/docs.git
Merge pull request #20049 from robmry/networking_intro_dns_fixes
Networking overview - DNS fixes
This commit is contained in:
commit
da6bcc7c60
|
@ -167,28 +167,12 @@ You can configure DNS resolution on a per-container basis, using flags for the
|
|||
The following table describes the available `docker run` flags related to DNS
|
||||
configuration.
|
||||
|
||||
| Flag | Description |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `--dns` | The IP address of a DNS server. To specify multiple DNS servers, use multiple `--dns` flags. If the container can't reach any of the IP addresses you specify, it uses Google's public DNS server at `8.8.8.8`. This allows containers to resolve internet domains. |
|
||||
| `--dns-search` | A DNS search domain to search non-fully qualified hostnames. To specify multiple DNS search prefixes, use multiple `--dns-search` flags. |
|
||||
| `--dns-opt` | A key-value pair representing a DNS option and its value. See your operating system's documentation for `resolv.conf` for valid options. |
|
||||
| `--hostname` | The hostname a container uses for itself. Defaults to the container's ID if not specified. |
|
||||
|
||||
### Nameservers with IPv6 addresses
|
||||
|
||||
If the `/etc/resolv.conf` file on the host system contains one or more
|
||||
nameserver entries with an IPv6 address, those nameserver entries get copied
|
||||
over to `/etc/resolv.conf` in containers that you run.
|
||||
|
||||
For containers using musl libc (in other words, Alpine Linux), this results in
|
||||
a race condition for hostname lookup. As a result, hostname resolution might
|
||||
sporadically fail if the external IPv6 DNS server wins the race condition
|
||||
against the embedded DNS server.
|
||||
|
||||
It's rare that the external DNS server is faster than the embedded one. But
|
||||
things like garbage collection, or large numbers of concurrent DNS requests,
|
||||
can sometimes result in a round trip to the external server being faster than local
|
||||
resolution.
|
||||
| Flag | Description |
|
||||
| -------------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `--dns` | The IP address of a DNS server. To specify multiple DNS servers, use multiple `--dns` flags. DNS requests will be forwarded from the container's network namespace so, for example, `--dns=127.0.0.1` refers to the container's own loopback address. |
|
||||
| `--dns-search` | A DNS search domain to search non-fully qualified hostnames. To specify multiple DNS search prefixes, use multiple `--dns-search` flags. |
|
||||
| `--dns-opt` | A key-value pair representing a DNS option and its value. See your operating system's documentation for `resolv.conf` for valid options. |
|
||||
| `--hostname` | The hostname a container uses for itself. Defaults to the container's ID if not specified. |
|
||||
|
||||
### Custom hosts
|
||||
|
||||
|
|
Loading…
Reference in New Issue