dns.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package option
  2. import "net/netip"
  3. type DNSOptions struct {
  4. Servers []DNSServerOptions `json:"servers,omitempty"`
  5. Rules []DNSRule `json:"rules,omitempty"`
  6. Final string `json:"final,omitempty"`
  7. ReverseMapping bool `json:"reverse_mapping,omitempty"`
  8. FakeIP *DNSFakeIPOptions `json:"fakeip,omitempty"`
  9. DNSClientOptions
  10. }
  11. type DNSServerOptions struct {
  12. Tag string `json:"tag,omitempty"`
  13. Address string `json:"address"`
  14. AddressResolver string `json:"address_resolver,omitempty"`
  15. AddressStrategy DomainStrategy `json:"address_strategy,omitempty"`
  16. AddressFallbackDelay Duration `json:"address_fallback_delay,omitempty"`
  17. Strategy DomainStrategy `json:"strategy,omitempty"`
  18. Detour string `json:"detour,omitempty"`
  19. ClientSubnet *AddrPrefix `json:"client_subnet,omitempty"`
  20. }
  21. type DNSClientOptions struct {
  22. Strategy DomainStrategy `json:"strategy,omitempty"`
  23. DisableCache bool `json:"disable_cache,omitempty"`
  24. DisableExpire bool `json:"disable_expire,omitempty"`
  25. IndependentCache bool `json:"independent_cache,omitempty"`
  26. ClientSubnet *AddrPrefix `json:"client_subnet,omitempty"`
  27. }
  28. type DNSFakeIPOptions struct {
  29. Enabled bool `json:"enabled,omitempty"`
  30. Inet4Range *netip.Prefix `json:"inet4_range,omitempty"`
  31. Inet6Range *netip.Prefix `json:"inet6_range,omitempty"`
  32. }