config.proto 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. syntax = "proto3";
  2. package xray.app.dns;
  3. option csharp_namespace = "Xray.App.Dns";
  4. option go_package = "github.com/xtls/xray-core/app/dns";
  5. option java_package = "com.xray.app.dns";
  6. option java_multiple_files = true;
  7. import "common/net/destination.proto";
  8. import "app/router/config.proto";
  9. message NameServer {
  10. xray.common.net.Endpoint address = 1;
  11. bytes client_ip = 5;
  12. bool skipFallback = 6;
  13. message PriorityDomain {
  14. DomainMatchingType type = 1;
  15. string domain = 2;
  16. }
  17. message OriginalRule {
  18. string rule = 1;
  19. uint32 size = 2;
  20. }
  21. repeated PriorityDomain prioritized_domain = 2;
  22. repeated xray.app.router.GeoIP expected_geoip = 3;
  23. repeated OriginalRule original_rules = 4;
  24. QueryStrategy query_strategy = 7;
  25. bool actPrior = 8;
  26. string tag = 9;
  27. uint64 timeoutMs = 10;
  28. bool disableCache = 11;
  29. bool finalQuery = 12;
  30. repeated xray.app.router.GeoIP unexpected_geoip = 13;
  31. bool actUnprior = 14;
  32. }
  33. enum DomainMatchingType {
  34. Full = 0;
  35. Subdomain = 1;
  36. Keyword = 2;
  37. Regex = 3;
  38. }
  39. enum QueryStrategy {
  40. USE_IP = 0;
  41. USE_IP4 = 1;
  42. USE_IP6 = 2;
  43. USE_SYS = 3;
  44. }
  45. message Config {
  46. // NameServer list used by this DNS client.
  47. // A special value 'localhost' as a domain address can be set to use DNS on local system.
  48. repeated NameServer name_server = 5;
  49. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  50. // (IPv6).
  51. bytes client_ip = 3;
  52. message HostMapping {
  53. DomainMatchingType type = 1;
  54. string domain = 2;
  55. repeated bytes ip = 3;
  56. // ProxiedDomain indicates the mapped domain has the same IP address on this
  57. // domain. Xray will use this domain for IP queries.
  58. string proxied_domain = 4;
  59. }
  60. repeated HostMapping static_hosts = 4;
  61. // Tag is the inbound tag of DNS client.
  62. string tag = 6;
  63. reserved 7;
  64. // DisableCache disables DNS cache
  65. bool disableCache = 8;
  66. QueryStrategy query_strategy = 9;
  67. bool disableFallback = 10;
  68. bool disableFallbackIfMatch = 11;
  69. }