config.proto 5.7 KB

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