2016-09-20 10:05:35 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2016-09-26 09:14:16 -04:00
|
|
|
package v2ray.core.app.dns;
|
2016-12-22 18:24:28 -05:00
|
|
|
option csharp_namespace = "V2Ray.Core.App.Dns";
|
2022-01-02 10:16:23 -05:00
|
|
|
option go_package = "github.com/v2fly/v2ray-core/v5/app/dns";
|
2016-09-26 09:14:16 -04:00
|
|
|
option java_package = "com.v2ray.core.app.dns";
|
2017-02-03 17:15:10 -05:00
|
|
|
option java_multiple_files = true;
|
2016-09-20 10:05:35 -04:00
|
|
|
|
2020-08-24 08:10:26 -04:00
|
|
|
import "common/net/address.proto";
|
|
|
|
import "common/net/destination.proto";
|
2021-09-07 04:13:58 -04:00
|
|
|
import "app/router/routercommon/common.proto";
|
2016-09-20 10:05:35 -04:00
|
|
|
|
2021-09-06 17:34:28 -04:00
|
|
|
import "common/protoext/extensions.proto";
|
|
|
|
|
2018-08-24 15:51:03 -04:00
|
|
|
message NameServer {
|
|
|
|
v2ray.core.common.net.Endpoint address = 1;
|
2020-12-11 18:15:29 -05:00
|
|
|
bytes client_ip = 5;
|
2021-04-08 22:35:26 -04:00
|
|
|
bool skipFallback = 6;
|
2018-08-24 15:51:03 -04:00
|
|
|
|
|
|
|
message PriorityDomain {
|
|
|
|
DomainMatchingType type = 1;
|
|
|
|
string domain = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-15 09:22:32 -04:00
|
|
|
message OriginalRule {
|
|
|
|
string rule = 1;
|
|
|
|
uint32 size = 2;
|
|
|
|
}
|
|
|
|
|
2018-08-24 15:51:03 -04:00
|
|
|
repeated PriorityDomain prioritized_domain = 2;
|
2021-09-07 04:13:58 -04:00
|
|
|
repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3;
|
2020-08-15 09:22:32 -04:00
|
|
|
repeated OriginalRule original_rules = 4;
|
2018-08-24 15:51:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
enum DomainMatchingType {
|
|
|
|
Full = 0;
|
|
|
|
Subdomain = 1;
|
|
|
|
Keyword = 2;
|
2018-09-19 10:10:42 -04:00
|
|
|
Regex = 3;
|
2018-08-24 15:51:03 -04:00
|
|
|
}
|
|
|
|
|
2021-03-19 03:55:18 -04:00
|
|
|
enum QueryStrategy {
|
|
|
|
USE_IP = 0;
|
|
|
|
USE_IP4 = 1;
|
|
|
|
USE_IP6 = 2;
|
|
|
|
}
|
|
|
|
|
2021-09-06 17:34:28 -04:00
|
|
|
|
|
|
|
message HostMapping {
|
|
|
|
DomainMatchingType type = 1;
|
|
|
|
string domain = 2;
|
|
|
|
|
|
|
|
repeated bytes ip = 3;
|
|
|
|
|
|
|
|
// ProxiedDomain indicates the mapped domain has the same IP address on this
|
|
|
|
// domain. V2Ray will use this domain for IP queries.
|
|
|
|
string proxied_domain = 4;
|
|
|
|
}
|
|
|
|
|
2016-09-20 10:05:35 -04:00
|
|
|
message Config {
|
2020-10-04 20:36:40 -04:00
|
|
|
// Nameservers used by this DNS. Only traditional UDP servers are support at
|
|
|
|
// the moment. A special value 'localhost' as a domain address can be set to
|
|
|
|
// use DNS on local system.
|
2018-08-24 15:51:03 -04:00
|
|
|
repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];
|
|
|
|
|
|
|
|
// NameServer list used by this DNS client.
|
|
|
|
repeated NameServer name_server = 5;
|
2016-10-18 04:31:39 -04:00
|
|
|
|
|
|
|
// Static hosts. Domain to IP.
|
2018-06-26 16:34:05 -04:00
|
|
|
// Deprecated. Use static_hosts.
|
|
|
|
map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
|
2018-06-26 11:14:51 -04:00
|
|
|
|
2020-10-04 20:36:40 -04:00
|
|
|
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
|
|
|
|
// (IPv6).
|
2018-06-26 17:23:59 -04:00
|
|
|
bytes client_ip = 3;
|
2018-06-26 16:34:05 -04:00
|
|
|
|
2021-09-06 17:34:28 -04:00
|
|
|
repeated HostMapping static_hosts = 4;
|
|
|
|
|
|
|
|
// Tag is the inbound tag of DNS client.
|
|
|
|
string tag = 6;
|
2019-01-30 15:04:29 -05:00
|
|
|
|
2021-09-06 17:34:28 -04:00
|
|
|
reserved 7;
|
2019-01-30 15:04:29 -05:00
|
|
|
|
2021-09-06 17:34:28 -04:00
|
|
|
// DisableCache disables DNS cache
|
|
|
|
bool disableCache = 8;
|
|
|
|
|
|
|
|
QueryStrategy query_strategy = 9;
|
|
|
|
|
|
|
|
bool disableFallback = 10;
|
2021-09-12 22:35:34 -04:00
|
|
|
|
|
|
|
bool disableFallbackIfMatch = 11;
|
2021-09-06 17:34:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message SimplifiedConfig {
|
|
|
|
option (v2ray.core.common.protoext.message_opt).type = "service";
|
2021-09-07 03:05:18 -04:00
|
|
|
option (v2ray.core.common.protoext.message_opt).short_name = "dns";
|
2021-09-06 17:34:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
// Nameservers used by this DNS. Only traditional UDP servers are support at
|
|
|
|
// the moment. A special value 'localhost' as a domain address can be set to
|
|
|
|
// use DNS on local system.
|
2021-09-10 15:35:02 -04:00
|
|
|
reserved 1;
|
2021-09-06 17:34:28 -04:00
|
|
|
|
|
|
|
// NameServer list used by this DNS client.
|
2021-09-10 15:35:02 -04:00
|
|
|
repeated SimplifiedNameServer name_server = 5;
|
2021-09-06 17:34:28 -04:00
|
|
|
|
|
|
|
// Static hosts. Domain to IP.
|
|
|
|
// Deprecated. Use static_hosts.
|
2021-09-10 15:35:02 -04:00
|
|
|
reserved 2;
|
2021-09-06 17:34:28 -04:00
|
|
|
|
|
|
|
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
|
|
|
|
// (IPv6).
|
2021-09-10 15:35:02 -04:00
|
|
|
string client_ip = 3;
|
2018-06-26 16:34:05 -04:00
|
|
|
|
|
|
|
repeated HostMapping static_hosts = 4;
|
2019-01-16 14:32:41 -05:00
|
|
|
|
|
|
|
// Tag is the inbound tag of DNS client.
|
|
|
|
string tag = 6;
|
2021-02-08 05:18:52 -05:00
|
|
|
|
|
|
|
reserved 7;
|
2021-02-24 03:03:50 -05:00
|
|
|
|
2021-04-08 22:35:26 -04:00
|
|
|
// DisableCache disables DNS cache
|
2021-02-24 03:03:50 -05:00
|
|
|
bool disableCache = 8;
|
2021-03-19 03:55:18 -04:00
|
|
|
|
|
|
|
QueryStrategy query_strategy = 9;
|
2021-04-08 22:35:26 -04:00
|
|
|
|
|
|
|
bool disableFallback = 10;
|
2021-09-12 22:35:34 -04:00
|
|
|
|
|
|
|
bool disableFallbackIfMatch = 11;
|
2016-09-20 10:05:35 -04:00
|
|
|
}
|
2021-09-10 15:35:02 -04:00
|
|
|
|
|
|
|
|
|
|
|
message SimplifiedHostMapping {
|
|
|
|
DomainMatchingType type = 1;
|
|
|
|
string domain = 2;
|
|
|
|
|
|
|
|
repeated string ip = 3;
|
|
|
|
|
|
|
|
// ProxiedDomain indicates the mapped domain has the same IP address on this
|
|
|
|
// domain. V2Ray will use this domain for IP queries.
|
|
|
|
string proxied_domain = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SimplifiedNameServer {
|
|
|
|
v2ray.core.common.net.Endpoint address = 1;
|
|
|
|
string client_ip = 5;
|
|
|
|
bool skipFallback = 6;
|
|
|
|
|
|
|
|
message PriorityDomain {
|
|
|
|
DomainMatchingType type = 1;
|
|
|
|
string domain = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message OriginalRule {
|
|
|
|
string rule = 1;
|
|
|
|
uint32 size = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
repeated PriorityDomain prioritized_domain = 2;
|
|
|
|
repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3;
|
|
|
|
repeated OriginalRule original_rules = 4;
|
|
|
|
}
|