config.proto 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. optional bool disableCache = 11;
  29. optional bool serveStale = 15;
  30. optional uint32 serveExpiredTTL = 16;
  31. bool finalQuery = 12;
  32. repeated xray.app.router.GeoIP unexpected_geoip = 13;
  33. bool actUnprior = 14;
  34. uint32 policyID = 17;
  35. }
  36. enum DomainMatchingType {
  37. Full = 0;
  38. Subdomain = 1;
  39. Keyword = 2;
  40. Regex = 3;
  41. }
  42. enum QueryStrategy {
  43. USE_IP = 0;
  44. USE_IP4 = 1;
  45. USE_IP6 = 2;
  46. USE_SYS = 3;
  47. }
  48. message Config {
  49. // NameServer list used by this DNS client.
  50. // A special value 'localhost' as a domain address can be set to use DNS on local system.
  51. repeated NameServer name_server = 5;
  52. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  53. // (IPv6).
  54. bytes client_ip = 3;
  55. message HostMapping {
  56. DomainMatchingType type = 1;
  57. string domain = 2;
  58. repeated bytes ip = 3;
  59. // ProxiedDomain indicates the mapped domain has the same IP address on this
  60. // domain. Xray will use this domain for IP queries.
  61. string proxied_domain = 4;
  62. }
  63. repeated HostMapping static_hosts = 4;
  64. // Tag is the inbound tag of DNS client.
  65. string tag = 6;
  66. reserved 7;
  67. // DisableCache disables DNS cache
  68. bool disableCache = 8;
  69. bool serveStale = 12;
  70. uint32 serveExpiredTTL = 13;
  71. QueryStrategy query_strategy = 9;
  72. bool disableFallback = 10;
  73. bool disableFallbackIfMatch = 11;
  74. bool enableParallelQuery = 14;
  75. }