mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-18 22:29:49 +03:00
refactor: new dns app
This commit is contained in:
@ -108,10 +108,11 @@ var typeMap = map[router.Domain_Type]dns.DomainMatchingType{
|
||||
|
||||
// DNSConfig is a JSON serializable object for dns.Config.
|
||||
type DNSConfig struct {
|
||||
Servers []*NameServerConfig `json:"servers"`
|
||||
Hosts map[string]*Address `json:"hosts"`
|
||||
ClientIP *Address `json:"clientIp"`
|
||||
Tag string `json:"tag"`
|
||||
Servers []*NameServerConfig `json:"servers"`
|
||||
Hosts map[string]*Address `json:"hosts"`
|
||||
ClientIP *Address `json:"clientIp"`
|
||||
Tag string `json:"tag"`
|
||||
DisableCache bool `json:"disableCache"`
|
||||
}
|
||||
|
||||
func getHostMapping(addr *Address) *dns.Config_HostMapping {
|
||||
@ -129,7 +130,8 @@ func getHostMapping(addr *Address) *dns.Config_HostMapping {
|
||||
// Build implements Buildable
|
||||
func (c *DNSConfig) Build() (*dns.Config, error) {
|
||||
config := &dns.Config{
|
||||
Tag: c.Tag,
|
||||
Tag: c.Tag,
|
||||
DisableCache: c.DisableCache,
|
||||
}
|
||||
|
||||
if c.ClientIP != nil {
|
||||
|
Reference in New Issue
Block a user