config.proto 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. message NameServer {
  11. v2ray.core.common.net.Endpoint address = 1;
  12. bytes client_ip = 5;
  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 v2ray.core.app.router.GeoIP geoip = 3;
  23. repeated OriginalRule original_rules = 4;
  24. }
  25. enum DomainMatchingType {
  26. Full = 0;
  27. Subdomain = 1;
  28. Keyword = 2;
  29. Regex = 3;
  30. }
  31. enum QueryStrategy {
  32. USE_IP = 0;
  33. USE_IP4 = 1;
  34. USE_IP6 = 2;
  35. }
  36. message Config {
  37. // Nameservers used by this DNS. Only traditional UDP servers are support at
  38. // the moment. A special value 'localhost' as a domain address can be set to
  39. // use DNS on local system.
  40. repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];
  41. // NameServer list used by this DNS client.
  42. repeated NameServer name_server = 5;
  43. // Static hosts. Domain to IP.
  44. // Deprecated. Use static_hosts.
  45. map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  46. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  47. // (IPv6).
  48. bytes client_ip = 3;
  49. message HostMapping {
  50. DomainMatchingType type = 1;
  51. string domain = 2;
  52. repeated bytes ip = 3;
  53. // ProxiedDomain indicates the mapped domain has the same IP address on this
  54. // domain. V2Ray will use this domain for IP queries. This field is only
  55. // effective if ip is empty.
  56. string proxied_domain = 4;
  57. }
  58. repeated HostMapping static_hosts = 4;
  59. // Tag is the inbound tag of DNS client.
  60. string tag = 6;
  61. reserved 7;
  62. // DisableCache Disable DNS cache
  63. bool disableCache = 8;
  64. QueryStrategy query_strategy = 9;
  65. }