config.proto 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. syntax = "proto3";
  2. package xray.app.dns;
  3. option csharp_namespace = "Xray.App.Dns";
  4. option go_package = "github.com/xtls/xray-core/v1/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. message PriorityDomain {
  13. DomainMatchingType type = 1;
  14. string domain = 2;
  15. }
  16. message OriginalRule {
  17. string rule = 1;
  18. uint32 size = 2;
  19. }
  20. repeated PriorityDomain prioritized_domain = 2;
  21. repeated xray.app.router.GeoIP geoip = 3;
  22. repeated OriginalRule original_rules = 4;
  23. }
  24. enum DomainMatchingType {
  25. Full = 0;
  26. Subdomain = 1;
  27. Keyword = 2;
  28. Regex = 3;
  29. }
  30. message Config {
  31. // Nameservers used by this DNS. Only traditional UDP servers are support at
  32. // the moment. A special value 'localhost' as a domain address can be set to
  33. // use DNS on local system.
  34. repeated xray.common.net.Endpoint NameServers = 1 [deprecated = true];
  35. // NameServer list used by this DNS client.
  36. repeated NameServer name_server = 5;
  37. // Static hosts. Domain to IP.
  38. // Deprecated. Use static_hosts.
  39. map<string, xray.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
  40. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
  41. // (IPv6).
  42. bytes client_ip = 3;
  43. message HostMapping {
  44. DomainMatchingType type = 1;
  45. string domain = 2;
  46. repeated bytes ip = 3;
  47. // ProxiedDomain indicates the mapped domain has the same IP address on this
  48. // domain. Xray will use this domain for IP queries. This field is only
  49. // effective if ip is empty.
  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. }