Skip to content

feature/wgcf/custom-dns-generation - #638

Open
michaelik1 wants to merge 6 commits into
ViRb3:masterfrom
michaelik1:feature/wgcf/custom-dns-generation
Open

michaelik1 wants to merge 6 commits into
ViRb3:masterfrom
michaelik1:feature/wgcf/custom-dns-generation

Conversation

@michaelik1

Copy link
Copy Markdown
Contributor

Motivation

Resolves #394.

Currently, wgcf always generates WireGuard profiles with fixed Cloudflare DNS servers. While these are suitable defaults, some users may prefer alternative DNS providers, such as NextDNS or AdGuard, or manage DNS settings themselves.

This change allows users to customize or omit the DNS setting without manually editing the generated profile, while preserving the existing behavior by default.

Description

Adds support for custom IPv4 and IPv6 DNS servers when generating WireGuard profiles.

Usage:

wgcf generate --dns 8.8.8.8,8.8.4.4       # sets custom DNS servers
wgcf generate --dns 8.8.8.8 --dns 1.1.1.1 # specifies multiple DNS servers
wgcf generate --no-dns                    # omits the DNS setting

The --dns flag accepts comma-separated IP addresses or can be specified multiple times.

The --dns and --no-dns flags are mutually exclusive and cannot be used together.

The default Cloudflare DNS servers remain unchanged for backward compatibility. Specifying custom DNS servers replaces these defaults.

Added tests for DNS validation, flag parsing, and generated profile output.


@ViRb3

@michaelik1

Copy link
Copy Markdown
Contributor Author

The same question I raised here(#634 (comment)) also applies to this PR. Should we preserve the current default DNS behavior for backward compatibility, or make DNS configuration explicit?

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.

Request support of Cloudflare Security DNS

1 participant