config.proto 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. syntax = "proto3";
  2. package v2ray.core.app.dns;
  3. option csharp_namespace = "V2Ray.Core.App.Dns";
  4. option go_package = "github.com/v2fly/v2ray-core/v5/app/dns";
  5. option java_package = "com.v2ray.core.app.dns";
  6. option java_multiple_files = true;
  7. import "common/net/address.proto";
  8. import "common/net/destination.proto";
  9. import "app/router/routercommon/common.proto";
  10. import "common/protoext/extensions.proto";
  11. message NameServer {
  12. v2ray.core.common.net.Endpoint address = 1;
  13. bytes client_ip = 5;
  14. string tag = 7;
  15. message PriorityDomain {
  16. DomainMatchingType type = 1;
  17. string domain = 2;
  18. }
  19. message OriginalRule {
  20. string rule = 1;
  21. uint32 size = 2;
  22. }
  23. repeated PriorityDomain prioritized_domain = 2;
  24. repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3;
  25. repeated OriginalRule original_rules = 4;
  26. // Deprecated. Use fallback_strategy.
  27. bool skipFallback = 6 [deprecated = true];
  28. optional QueryStrategy query_strategy = 8;
  29. optional CacheStrategy cache_strategy = 9;
  30. optional FallbackStrategy fallback_strategy = 10;
  31. }
  32. enum DomainMatchingType {
  33. Full = 0;
  34. Subdomain = 1;
  35. Keyword = 2;
  36. Regex = 3;
  37. }
  38. enum QueryStrategy {
  39. USE_IP = 0;
  40. USE_IP4 = 1;
  41. USE_IP6 = 2;
  42. }
  43. enum CacheStrategy {
  44. CacheEnabled = 0;
  45. CacheDisabled = 1;
  46. }
  47. enum FallbackStrategy {
  48. Enabled = 0;
  49. Disabled = 1;
  50. DisabledIfAnyMatch = 2;
  51. }
  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. V2Ray will use this domain for IP queries.
  58. string proxied_domain = 4;
  59. }
  60. message Config {
  61. // Nameservers used by this DNS. Only traditional UDP servers are support at
  62. // the moment. A special value 'localhost' as a domain address can be set to
  63. // use DNS on local system.
  64. repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];
  65. // NameServer list used by this DNS client.
  66. repeated NameServer name_server = 5;
  67. // Static hosts. Domain to IP.
  68. // Deprecated. Use static_hosts.
  69. map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  70. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  71. // (IPv6).
  72. bytes client_ip = 3;
  73. repeated HostMapping static_hosts = 4;
  74. // Tag is the inbound tag of DNS client.
  75. string tag = 6;
  76. reserved 7;
  77. // DisableCache disables DNS cache
  78. // Deprecated. Use cache_strategy.
  79. bool disableCache = 8 [deprecated = true];
  80. // Deprecated. Use fallback_strategy.
  81. bool disableFallback = 10 [deprecated = true];
  82. // Deprecated. Use fallback_strategy.
  83. bool disableFallbackIfMatch = 11 [deprecated = true];
  84. // Default query strategy (IPv4, IPv6, or both) for each name server.
  85. QueryStrategy query_strategy = 9;
  86. // Default cache strategy for each name server.
  87. CacheStrategy cache_strategy = 12;
  88. // Default fallback strategy for each name server.
  89. FallbackStrategy fallback_strategy = 13;
  90. }
  91. message SimplifiedConfig {
  92. option (v2ray.core.common.protoext.message_opt).type = "service";
  93. option (v2ray.core.common.protoext.message_opt).short_name = "dns";
  94. // Nameservers used by this DNS. Only traditional UDP servers are support at
  95. // the moment. A special value 'localhost' as a domain address can be set to
  96. // use DNS on local system.
  97. reserved 1;
  98. // NameServer list used by this DNS client.
  99. repeated SimplifiedNameServer name_server = 5;
  100. // Static hosts. Domain to IP.
  101. // Deprecated. Use static_hosts.
  102. reserved 2;
  103. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  104. // (IPv6).
  105. string client_ip = 3;
  106. repeated HostMapping static_hosts = 4;
  107. // Tag is the inbound tag of DNS client.
  108. string tag = 6;
  109. reserved 7;
  110. // DisableCache disables DNS cache
  111. // Deprecated. Use cache_strategy.
  112. bool disableCache = 8 [deprecated = true];
  113. // Deprecated. Use fallback_strategy.
  114. bool disableFallback = 10 [deprecated = true];
  115. // Deprecated. Use fallback_strategy.
  116. bool disableFallbackIfMatch = 11 [deprecated = true];
  117. // Default query strategy (IPv4, IPv6, or both) for each name server.
  118. QueryStrategy query_strategy = 9;
  119. // Default cache strategy for each name server.
  120. CacheStrategy cache_strategy = 12;
  121. // Default fallback strategy for each name server.
  122. FallbackStrategy fallback_strategy = 13;
  123. }
  124. message SimplifiedHostMapping {
  125. DomainMatchingType type = 1;
  126. string domain = 2;
  127. repeated string ip = 3;
  128. // ProxiedDomain indicates the mapped domain has the same IP address on this
  129. // domain. V2Ray will use this domain for IP queries.
  130. string proxied_domain = 4;
  131. }
  132. message SimplifiedNameServer {
  133. v2ray.core.common.net.Endpoint address = 1;
  134. string client_ip = 5;
  135. string tag = 7;
  136. message PriorityDomain {
  137. DomainMatchingType type = 1;
  138. string domain = 2;
  139. }
  140. message OriginalRule {
  141. string rule = 1;
  142. uint32 size = 2;
  143. }
  144. repeated PriorityDomain prioritized_domain = 2;
  145. repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3;
  146. repeated OriginalRule original_rules = 4;
  147. // Deprecated. Use fallback_strategy.
  148. bool skipFallback = 6 [deprecated = true];
  149. optional QueryStrategy query_strategy = 8;
  150. optional CacheStrategy cache_strategy = 9;
  151. optional FallbackStrategy fallback_strategy = 10;
  152. }