Skip to content

Commit b1fdf6c

Browse files
author
kix
committed
Revert "feat: add built-in DNS server functionality with configuration toggle"
This reverts commit 8f2f960.
1 parent 8f2f960 commit b1fdf6c

File tree

6 files changed

+448
-332
lines changed

6 files changed

+448
-332
lines changed

config/config.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ type Dns struct {
121121
FixedDomainTtl []KeyableString `mapstructure:"fixed_domain_ttl"`
122122
Upstream []KeyableString `mapstructure:"upstream"`
123123
Routing DnsRouting `mapstructure:"routing"`
124-
Server DnsServerConfig `mapstructure:"server"`
125124
}
126125

127126
type Routing struct {
@@ -138,12 +137,6 @@ type Config struct {
138137
Dns Dns `mapstructure:"dns" desc:"DnsDesc"`
139138
}
140139

141-
// DNS服务器配置
142-
type DnsServerConfig struct {
143-
Enabled bool `mapstructure:"enabled" default:"false"`
144-
Addresses []string `mapstructure:"address"`
145-
}
146-
147140
// New params from sections. This func assumes merging (section "include") and deduplication for section names has been executed.
148141
func New(sections []*config_parser.Section) (conf *Config, err error) {
149142
// Set up name to section for further use.

control/control_plane.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ import (
4545
"golang.org/x/sys/unix"
4646
)
4747

48-
// dialArgument contains information for DNS dialing decision
49-
type dialArgument struct {
50-
l4proto consts.L4ProtoStr
51-
ipversion consts.IpVersionStr
52-
bestDialer *dialer.Dialer
53-
bestOutbound *outbound.DialerGroup
54-
bestTarget netip.AddrPort
55-
mark uint32
56-
mptcp bool
57-
}
58-
5948
type ControlPlane struct {
6049
log *logrus.Logger
6150

@@ -515,15 +504,6 @@ func NewControlPlane(
515504
}
516505
go dnsUpstream.InitUpstreams()
517506

518-
// 启动DNS服务器(如果已配置)
519-
if dnsConfig.Server.Enabled && len(dnsConfig.Server.Addresses) > 0 {
520-
log.Infof("Starting DNS server on addresses: %v", dnsConfig.Server.Addresses)
521-
if err = plane.dnsController.StartDnsServer(dnsConfig.Server.Addresses); err != nil {
522-
log.WithError(err).Errorf("Failed to start DNS server")
523-
// 不返回错误,允许DAE在DNS服务器启动失败时继续运行
524-
}
525-
}
526-
527507
close(plane.ready)
528508
return plane, nil
529509
}

0 commit comments

Comments
 (0)