dns.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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. }
  20. type DNSClientOptions struct {
  21. Strategy DomainStrategy `json:"strategy,omitempty"`
  22. DisableCache bool `json:"disable_cache,omitempty"`
  23. DisableExpire bool `json:"disable_expire,omitempty"`
  24. IndependentCache bool `json:"independent_cache,omitempty"`
  25. }
  26. type DNSFakeIPOptions struct {
  27. Enabled bool `json:"enabled,omitempty"`
  28. Inet4Range *netip.Prefix `json:"inet4_range,omitempty"`
  29. Inet6Range *netip.Prefix `json:"inet6_range,omitempty"`
  30. }