config.proto 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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/address.proto";
  8. import "common/net/destination.proto";
  9. import "app/router/config.proto";
  10. message NameServer {
  11. xray.common.net.Endpoint address = 1;
  12. bytes client_ip = 5;
  13. bool skipFallback = 6;
  14. message PriorityDomain {
  15. DomainMatchingType type = 1;
  16. string domain = 2;
  17. }
  18. message OriginalRule {
  19. string rule = 1;
  20. uint32 size = 2;
  21. }
  22. repeated PriorityDomain prioritized_domain = 2;
  23. repeated xray.app.router.GeoIP geoip = 3;
  24. repeated OriginalRule original_rules = 4;
  25. }
  26. enum DomainMatchingType {
  27. Full = 0;
  28. Subdomain = 1;
  29. Keyword = 2;
  30. Regex = 3;
  31. }
  32. enum QueryStrategy {
  33. USE_IP = 0;
  34. USE_IP4 = 1;
  35. USE_IP6 = 2;
  36. }
  37. message Config {
  38. // Nameservers used by this DNS. Only traditional UDP servers are support at
  39. // the moment. A special value 'localhost' as a domain address can be set to
  40. // use DNS on local system.
  41. repeated xray.common.net.Endpoint NameServers = 1 [deprecated = true];
  42. // NameServer list used by this DNS client.
  43. repeated NameServer name_server = 5;
  44. // Static hosts. Domain to IP.
  45. // Deprecated. Use static_hosts.
  46. map<string, xray.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  47. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  48. // (IPv6).
  49. bytes client_ip = 3;
  50. message HostMapping {
  51. DomainMatchingType type = 1;
  52. string domain = 2;
  53. repeated bytes ip = 3;
  54. // ProxiedDomain indicates the mapped domain has the same IP address on this
  55. // domain. Xray will use this domain for IP queries.
  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 disables DNS cache
  63. bool disableCache = 8;
  64. QueryStrategy query_strategy = 9;
  65. bool disableFallback = 10;
  66. bool disableFallbackIfMatch = 11;
  67. }