config.proto 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 geoip = 3;
  23. repeated OriginalRule original_rules = 4;
  24. QueryStrategy query_strategy = 7;
  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. // NameServer list used by this DNS client.
  39. // A special value 'localhost' as a domain address can be set to use DNS on local system.
  40. repeated NameServer name_server = 5;
  41. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  42. // (IPv6).
  43. bytes client_ip = 3;
  44. message HostMapping {
  45. DomainMatchingType type = 1;
  46. string domain = 2;
  47. repeated bytes ip = 3;
  48. // ProxiedDomain indicates the mapped domain has the same IP address on this
  49. // domain. Xray will use this domain for IP queries.
  50. string proxied_domain = 4;
  51. }
  52. repeated HostMapping static_hosts = 4;
  53. // Tag is the inbound tag of DNS client.
  54. string tag = 6;
  55. reserved 7;
  56. // DisableCache disables DNS cache
  57. bool disableCache = 8;
  58. QueryStrategy query_strategy = 9;
  59. bool disableFallback = 10;
  60. bool disableFallbackIfMatch = 11;
  61. }