config.proto 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. QueryStrategy query_strategy = 7;
  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 Config {
  39. // Nameservers used by this DNS. Only traditional UDP servers are support at
  40. // the moment. A special value 'localhost' as a domain address can be set to
  41. // use DNS on local system.
  42. repeated xray.common.net.Endpoint NameServers = 1 [deprecated = true];
  43. // NameServer list used by this DNS client.
  44. repeated NameServer name_server = 5;
  45. // Static hosts. Domain to IP.
  46. // Deprecated. Use static_hosts.
  47. map<string, xray.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  48. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  49. // (IPv6).
  50. bytes client_ip = 3;
  51. message HostMapping {
  52. DomainMatchingType type = 1;
  53. string domain = 2;
  54. repeated bytes ip = 3;
  55. // ProxiedDomain indicates the mapped domain has the same IP address on this
  56. // domain. Xray will use this domain for IP queries.
  57. string proxied_domain = 4;
  58. }
  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. bool disableFallbackIfMatch = 11;
  68. }