config.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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/v4/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/config.proto";
  10. import "common/protoext/extensions.proto";
  11. message NameServer {
  12. v2ray.core.common.net.Endpoint address = 1;
  13. bytes client_ip = 5;
  14. bool skipFallback = 6;
  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.GeoIP geoip = 3;
  25. repeated OriginalRule original_rules = 4;
  26. }
  27. enum DomainMatchingType {
  28. Full = 0;
  29. Subdomain = 1;
  30. Keyword = 2;
  31. Regex = 3;
  32. }
  33. enum QueryStrategy {
  34. USE_IP = 0;
  35. USE_IP4 = 1;
  36. USE_IP6 = 2;
  37. }
  38. message HostMapping {
  39. DomainMatchingType type = 1;
  40. string domain = 2;
  41. repeated bytes ip = 3;
  42. // ProxiedDomain indicates the mapped domain has the same IP address on this
  43. // domain. V2Ray will use this domain for IP queries.
  44. string proxied_domain = 4;
  45. }
  46. message Config {
  47. // Nameservers used by this DNS. Only traditional UDP servers are support at
  48. // the moment. A special value 'localhost' as a domain address can be set to
  49. // use DNS on local system.
  50. repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];
  51. // NameServer list used by this DNS client.
  52. repeated NameServer name_server = 5;
  53. // Static hosts. Domain to IP.
  54. // Deprecated. Use static_hosts.
  55. map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  56. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  57. // (IPv6).
  58. bytes client_ip = 3;
  59. repeated HostMapping static_hosts = 4;
  60. // Tag is the inbound tag of DNS client.
  61. string tag = 6;
  62. reserved 7;
  63. // DisableCache disables DNS cache
  64. bool disableCache = 8;
  65. QueryStrategy query_strategy = 9;
  66. bool disableFallback = 10;
  67. }
  68. message SimplifiedConfig {
  69. option (v2ray.core.common.protoext.message_opt).type = "service";
  70. option (v2ray.core.common.protoext.message_opt).short_name = "dns";
  71. // Nameservers used by this DNS. Only traditional UDP servers are support at
  72. // the moment. A special value 'localhost' as a domain address can be set to
  73. // use DNS on local system.
  74. repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];
  75. // NameServer list used by this DNS client.
  76. repeated NameServer name_server = 5;
  77. // Static hosts. Domain to IP.
  78. // Deprecated. Use static_hosts.
  79. map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  80. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  81. // (IPv6).
  82. bytes client_ip = 3;
  83. repeated HostMapping static_hosts = 4;
  84. // Tag is the inbound tag of DNS client.
  85. string tag = 6;
  86. reserved 7;
  87. // DisableCache disables DNS cache
  88. bool disableCache = 8;
  89. QueryStrategy query_strategy = 9;
  90. bool disableFallback = 10;
  91. }