Skip to content

Add DNS forwarder to veil-proxy.#70

Closed
NullHypothesis wants to merge 1 commit into
masterfrom
add-dns-forwarder
Closed

Add DNS forwarder to veil-proxy.#70
NullHypothesis wants to merge 1 commit into
masterfrom
add-dns-forwarder

Conversation

@NullHypothesis
Copy link
Copy Markdown
Contributor

Users currently have little flexibility in how their enclave uses DNS: veil-daemon's -resolver flag is all there is. Users however may also want to configure search domains, or have the enclave's DNS handled like the EC2 host's.

To make all of that possible, this PR introduces a new command line flag to veil-proxy: -dns-forwarder. When enabled, it instructs veil-proxy to open both a UDP and TCP listener on port 53 on the tun interface. All incoming payload (the forwarder has no understanding of DNS; it simply shuffles around bytes) is then blindly forwarded to the EC2 host's nameservers configured in /etc/resolv.conf.

To make use of this feature, start veil-proxy with the new flag:

veil-proxy -dns-forwarder

Then, set veil-daemon's resolver to the host's IP address:

veil-daemon -resolver 10.0.0.1

Fixes #61.

Users currently have little flexibility in how their enclave uses DNS:
veil-daemon's -resolver flag is all there is. Users however may also
want to configure search domains, or have the enclave's DNS handled like
the EC2 host's. To make all of that possible, this PR introduces new
command line flags to both veil-daemon and veil-proxy.

The proxy now has `-dns-forwarder`.  When enabled, it instructs the
proxy to open both a UDP and TCP listener on port 53 on the tun
interface. All incoming payload (the forwarder has no understanding of
DNS; it simply shuffles around bytes) is then blindly forwarded to the
EC2 host's nameservers configured in /etc/resolv.conf.

The daemon now has `-dns-search`, `-dns-ndots`, and the PR also renames
`-resolver` to `-dns-resolver` for consistency. The two new flags allow
users to provide the search domains and ndots option, both of which are
written to the enclave's /etc/resolve.conf.

To make use of these features, start veil-proxy with the new flag:

    veil-proxy -dns-forwarder

Then, set veil-daemon's resolver to the host's IP address, and you can
also provide search domains and ndots:

    veil-daemon \
        -dns-resolver 10.0.0.1 \
        -dns-search "cluster.local" \
        -dns-ndots 2

Fixes #61.
@NullHypothesis NullHypothesis deleted the add-dns-forwarder branch May 23, 2026 15:15
@NullHypothesis NullHypothesis restored the add-dns-forwarder branch May 23, 2026 15:15
@NullHypothesis
Copy link
Copy Markdown
Contributor Author

Continuing the work in #71.

@NullHypothesis NullHypothesis deleted the add-dns-forwarder branch May 26, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default resolver and search domains

1 participant