github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/app/dns/config.proto (about) 1 syntax = "proto3"; 2 3 package v2ray.core.app.dns; 4 option csharp_namespace = "V2Ray.Core.App.Dns"; 5 option go_package = "github.com/v2fly/v2ray-core/v5/app/dns"; 6 option java_package = "com.v2ray.core.app.dns"; 7 option java_multiple_files = true; 8 9 import "common/net/address.proto"; 10 import "common/net/destination.proto"; 11 import "app/router/routercommon/common.proto"; 12 import "app/dns/fakedns/fakedns.proto"; 13 14 import "common/protoext/extensions.proto"; 15 16 message NameServer { 17 v2ray.core.common.net.Endpoint address = 1; 18 bytes client_ip = 5; 19 string tag = 7; 20 21 message PriorityDomain { 22 DomainMatchingType type = 1; 23 string domain = 2; 24 } 25 26 message OriginalRule { 27 string rule = 1; 28 uint32 size = 2; 29 } 30 31 repeated PriorityDomain prioritized_domain = 2; 32 repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3; 33 repeated OriginalRule original_rules = 4; 34 35 v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 11; 36 37 // Deprecated. Use fallback_strategy. 38 bool skipFallback = 6 [deprecated = true]; 39 40 optional QueryStrategy query_strategy = 8; 41 optional CacheStrategy cache_strategy = 9; 42 optional FallbackStrategy fallback_strategy = 10; 43 } 44 45 enum DomainMatchingType { 46 Full = 0; 47 Subdomain = 1; 48 Keyword = 2; 49 Regex = 3; 50 } 51 52 enum QueryStrategy { 53 USE_IP = 0; 54 USE_IP4 = 1; 55 USE_IP6 = 2; 56 } 57 58 enum CacheStrategy { 59 CacheEnabled = 0; 60 CacheDisabled = 1; 61 } 62 63 enum FallbackStrategy { 64 Enabled = 0; 65 Disabled = 1; 66 DisabledIfAnyMatch = 2; 67 } 68 69 message HostMapping { 70 DomainMatchingType type = 1; 71 string domain = 2; 72 73 repeated bytes ip = 3; 74 75 // ProxiedDomain indicates the mapped domain has the same IP address on this 76 // domain. V2Ray will use this domain for IP queries. 77 string proxied_domain = 4; 78 } 79 80 message Config { 81 // Nameservers used by this DNS. Only traditional UDP servers are support at 82 // the moment. A special value 'localhost' as a domain address can be set to 83 // use DNS on local system. 84 repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true]; 85 86 // NameServer list used by this DNS client. 87 repeated NameServer name_server = 5; 88 89 // Static hosts. Domain to IP. 90 // Deprecated. Use static_hosts. 91 map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true]; 92 93 // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes 94 // (IPv6). 95 bytes client_ip = 3; 96 97 // Static domain-ip mapping in DNS server. 98 repeated HostMapping static_hosts = 4; 99 100 // Global fakedns object. 101 v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 16; 102 103 // Tag is the inbound tag of DNS client. 104 string tag = 6; 105 106 reserved 7; 107 108 // Domain matcher to use 109 string domain_matcher = 15; 110 111 // DisableCache disables DNS cache 112 // Deprecated. Use cache_strategy. 113 bool disableCache = 8 [deprecated = true]; 114 115 // Deprecated. Use fallback_strategy. 116 bool disableFallback = 10 [deprecated = true]; 117 118 // Deprecated. Use fallback_strategy. 119 bool disableFallbackIfMatch = 11 [deprecated = true]; 120 121 // Default query strategy (IPv4, IPv6, or both) for each name server. 122 QueryStrategy query_strategy = 9; 123 124 // Default cache strategy for each name server. 125 CacheStrategy cache_strategy = 12; 126 127 // Default fallback strategy for each name server. 128 FallbackStrategy fallback_strategy = 13; 129 } 130 131 132 message SimplifiedConfig { 133 option (v2ray.core.common.protoext.message_opt).type = "service"; 134 option (v2ray.core.common.protoext.message_opt).short_name = "dns"; 135 136 137 // Nameservers used by this DNS. Only traditional UDP servers are support at 138 // the moment. A special value 'localhost' as a domain address can be set to 139 // use DNS on local system. 140 reserved 1; 141 142 // NameServer list used by this DNS client. 143 repeated SimplifiedNameServer name_server = 5; 144 145 // Static hosts. Domain to IP. 146 // Deprecated. Use static_hosts. 147 reserved 2; 148 149 // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes 150 // (IPv6). 151 string client_ip = 3; 152 153 // Static domain-ip mapping in DNS server. 154 repeated SimplifiedHostMapping static_hosts = 4; 155 156 // Global fakedns object. 157 v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 16; 158 159 // Tag is the inbound tag of DNS client. 160 string tag = 6; 161 162 reserved 7; 163 164 // Domain matcher to use 165 string domain_matcher = 15; 166 167 // DisableCache disables DNS cache 168 // Deprecated. Use cache_strategy. 169 bool disableCache = 8 [deprecated = true]; 170 171 // Deprecated. Use fallback_strategy. 172 bool disableFallback = 10 [deprecated = true]; 173 174 // Deprecated. Use fallback_strategy. 175 bool disableFallbackIfMatch = 11 [deprecated = true]; 176 177 // Default query strategy (IPv4, IPv6, or both) for each name server. 178 QueryStrategy query_strategy = 9; 179 180 // Default cache strategy for each name server. 181 CacheStrategy cache_strategy = 12; 182 183 // Default fallback strategy for each name server. 184 FallbackStrategy fallback_strategy = 13; 185 } 186 187 188 message SimplifiedHostMapping { 189 DomainMatchingType type = 1; 190 string domain = 2; 191 192 repeated string ip = 3; 193 194 // ProxiedDomain indicates the mapped domain has the same IP address on this 195 // domain. V2Ray will use this domain for IP queries. 196 string proxied_domain = 4; 197 } 198 199 message SimplifiedNameServer { 200 v2ray.core.common.net.Endpoint address = 1; 201 string client_ip = 5; 202 string tag = 7; 203 204 message PriorityDomain { 205 DomainMatchingType type = 1; 206 string domain = 2; 207 } 208 209 message OriginalRule { 210 string rule = 1; 211 uint32 size = 2; 212 } 213 214 repeated PriorityDomain prioritized_domain = 2; 215 repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3; 216 repeated OriginalRule original_rules = 4; 217 218 v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 11; 219 220 // Deprecated. Use fallback_strategy. 221 bool skipFallback = 6 [deprecated = true]; 222 223 optional QueryStrategy query_strategy = 8; 224 optional CacheStrategy cache_strategy = 9; 225 optional FallbackStrategy fallback_strategy = 10; 226 repeated v2ray.core.app.router.routercommon.GeoSite geo_domain = 68001; 227 }