Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Sources/Services/ContainerAPIService/Client/Flags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,19 @@ public struct Flags {

@Option(
name: .customLong("dns-domain"),
help: .init("Default DNS domain", valueName: "domain")
help: .init(
"Set guest /etc/resolv.conf domain; does not register host or guest DNS records. Use 'container system dns create' and config.toml [dns] for local DNS domains",
valueName: "domain"
)
)
public var domain: String? = nil

@Option(
name: .customLong("dns-option"),
help: .init("DNS options", valueName: "option")
help: .init(
"Set guest /etc/resolv.conf options (debug, ndots:0); does not register DNS records. Use 'container system dns create' and config.toml [dns] for local domains",
valueName: "option"
)
)
public var options: [String] = []

Expand Down
8 changes: 4 additions & 4 deletions docs/command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ container run [<options>] <image> [<arguments> ...]
* `--cidfile <cidfile>`: Write the container ID to the path provided
* `-d, --detach`: Run the container and detach from the process
* `--dns <ip>`: DNS nameserver IP address
* `--dns-domain <domain>`: Default DNS domain
* `--dns-option <option>`: DNS options
* `--dns-domain <domain>`: Set the default domain written to the guest container's `/etc/resolv.conf`. This does not register host- or guest-resolvable DNS records; use `container system dns create` and the `config.toml` `[dns]` domain setting to configure local container DNS domains.
* `--dns-option <option>`: Add a resolver option written to the guest container's `/etc/resolv.conf`, such as `debug`, `ndots:0`, `timeout:1`, `attempts:1`, or `rotate`. This does not register host- or guest-resolvable DNS records; use `container system dns create` and the `config.toml` `[dns]` domain setting to configure local container DNS domains.
* `--dns-search <domain>`: DNS search domains
* `--entrypoint <cmd>`: Override the entrypoint of the image
* `--init`: Run an init process inside the container that forwards signals and reaps processes
Expand Down Expand Up @@ -211,8 +211,8 @@ container create [<options>] <image> [<arguments> ...]
* `--cidfile <cidfile>`: Write the container ID to the path provided
* `-d, --detach`: Run the container and detach from the process
* `--dns <ip>`: DNS nameserver IP address
* `--dns-domain <domain>`: Default DNS domain
* `--dns-option <option>`: DNS options
* `--dns-domain <domain>`: Set the default domain written to the guest container's `/etc/resolv.conf`. This does not register host- or guest-resolvable DNS records; use `container system dns create` and the `config.toml` `[dns]` domain setting to configure local container DNS domains.
* `--dns-option <option>`: Add a resolver option written to the guest container's `/etc/resolv.conf`, such as `debug`, `ndots:0`, `timeout:1`, `attempts:1`, or `rotate`. This does not register host- or guest-resolvable DNS records; use `container system dns create` and the `config.toml` `[dns]` domain setting to configure local container DNS domains.
* `--dns-search <domain>`: DNS search domains
* `--entrypoint <cmd>`: Override the entrypoint of the image
* `--init`: Run an init process inside the container that forwards signals and reaps processes
Expand Down
2 changes: 2 additions & 0 deletions docs/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ Create a domain for host connection:
sudo container system dns create host.container.internal --localhost 203.0.113.113
```

DNS flags on `container run` and `container create`, such as `--dns-domain` and `--dns-option`, only configure the guest container's `/etc/resolv.conf`. They do not create DNS records or make names like `name.<domain>` resolve from the host or from a guest. Use `container system dns create` to create local DNS domains, and set the default local container DNS domain with the `config.toml` `[dns]` domain setting or `container system property set dns.domain <domain>`.

Test access to the host HTTP server from a container:

```console
Expand Down