Advertisement
r43k3n

dnscrypt-proxy-v2.toml

Aug 2nd, 2018
1,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.04 KB | None | 0 0
  1. ##############################################
  2. # #
  3. # dnscrypt-proxy configuration #
  4. # #
  5. ##############################################
  6.  
  7. ## This is an example configuration file.
  8. ## You should adjust it to your needs, and save it as "dnscrypt-proxy.toml"
  9. ##
  10. ## Online documentation is available here: https://dnscrypt.info/doc
  11.  
  12.  
  13.  
  14. ##################################
  15. # Global settings #
  16. ##################################
  17.  
  18. ## List of servers to use
  19. ##
  20. ## Servers from the "public-resolvers" source (see down below) can
  21. ## be viewed here: https://dnscrypt.info/public-servers
  22. ##
  23. ## If this line is commented, all registered servers matching the require_* filters
  24. ## will be used.
  25. ##
  26. ## The proxy will automatically pick the fastest, working servers from the list.
  27. ## Remove the leading # first to enable this; lines starting with # are ignored.
  28.  
  29. server_names = ['soltysiak', 'securedns', 'dnscrypt.eu-dk', 'dnscrypt.eu-nl', 'dnscrypt.nl-ns0', 'dnscrypt.ca-1', 'dnscrypt.ca-2', 'cloudflare']
  30.  
  31.  
  32. ## List of local addresses and ports to listen to. Can be IPv4 and/or IPv6.
  33. ## Note: When using systemd socket activation, choose an empty set (i.e. [] ).
  34.  
  35. listen_addresses = ['127.0.0.1:5353']
  36.  
  37.  
  38. ## Maximum number of simultaneous client connections to accept
  39.  
  40. max_clients = 250
  41.  
  42.  
  43. ## Require servers (from static + remote sources) to satisfy specific properties
  44.  
  45. # Use servers reachable over IPv4
  46. ipv4_servers = true
  47.  
  48. # Use servers reachable over IPv6 -- Do not enable if you don't have IPv6 connectivity
  49. ipv6_servers = false
  50.  
  51. # Use servers implementing the DNSCrypt protocol
  52. dnscrypt_servers = true
  53.  
  54. # Use servers implementing the DNS-over-HTTPS protocol
  55. doh_servers = true
  56.  
  57.  
  58. ## Require servers defined by remote sources to satisfy specific properties
  59.  
  60. # Server must support DNS security extensions (DNSSEC)
  61. require_dnssec = true
  62.  
  63. # Server must not log user queries (declarative)
  64. require_nolog = true
  65.  
  66. # Server must not enforce its own blacklist (for parental control, ads blocking...)
  67. require_nofilter = true
  68.  
  69.  
  70. ## Always use TCP to connect to upstream servers.
  71. ## This can be can be useful if you need to route everything through Tor.
  72. ## Otherwise, leave this to `false`, as it doesn't improve security
  73. ## (dnscrypt-proxy will always encrypt everything even using UDP), and can
  74. ## only increase latency.
  75.  
  76. force_tcp = false
  77.  
  78.  
  79. ## HTTP / SOCKS proxy
  80. ## Uncomment the following line to route all TCP connections to a local Tor node
  81. ## Tor doesn't support UDP, so set `force_tcp` to `true` as well.
  82.  
  83. # proxy = "socks5://127.0.0.1:9050"
  84.  
  85.  
  86.  
  87. ## How long a DNS query will wait for a response, in milliseconds
  88.  
  89. timeout = 2500
  90.  
  91.  
  92. ## Keepalive for HTTP (HTTPS, HTTP/2) queries, in seconds
  93.  
  94. keepalive = 30
  95.  
  96.  
  97. ## Load-balancing strategy: 'p2' (default), 'ph', 'fastest' or 'random'
  98.  
  99. lb_strategy = 'p2'
  100.  
  101.  
  102. ## Log level (0-6, default: 2 - 0 is very verbose, 6 only contains fatal errors)
  103.  
  104. log_level = 2
  105.  
  106.  
  107. ## log file for the application
  108.  
  109. log_file = 'dnscrypt-proxy-v2.log'
  110.  
  111.  
  112. ## Use the system logger (syslog on Unix, Event Log on Windows)
  113.  
  114. use_syslog = true
  115.  
  116.  
  117. ## Delay, in minutes, after which certificates are reloaded
  118.  
  119. cert_refresh_delay = 240
  120.  
  121.  
  122. ## DNSCrypt: Create a new, unique key for every single DNS query
  123. ## This may improve privacy but can also have a significant impact on CPU usage
  124. ## Only enable if you don't have a lot of network load
  125.  
  126. dnscrypt_ephemeral_keys = false
  127.  
  128.  
  129. ## DoH: Disable TLS session tickets - increases privacy but also latency
  130.  
  131. tls_disable_session_tickets = false
  132.  
  133.  
  134. ## DoH: Use a specific cipher suite instead of the server preference
  135. ## 49199 = TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  136. ## 49195 = TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  137. ## 52392 = TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
  138. ## 52393 = TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
  139. ##
  140. ## On non-Intel CPUs such as MIPS routers and ARM systems (Android, Raspberry Pi...),
  141. ## the following suite improves performance.
  142. ## This may also help on Intel CPUs running 32-bit operating systems.
  143. ##
  144. ## Keep tls_cipher_suite empty if you have issues fetching sources or
  145. ## connecting to some DoH servers. Google and Cloudflare are fine with it.
  146.  
  147. tls_cipher_suite = [52392, 49199]
  148.  
  149.  
  150. ## Fallback resolver
  151. ## This is a normal, non-encrypted DNS resolver, that will be only used
  152. ## for one-shot queries when retrieving the initial resolvers list, and
  153. ## only if the system DNS configuration doesn't work.
  154. ## No user application queries will ever be leaked through this resolver,
  155. ## and it will not be used after IP addresses of resolvers URLs have been found.
  156. ## It will never be used if lists have already been cached, and if stamps
  157. ## don't include host names without IP addresses.
  158. ## It will not be used if the configured system DNS works.
  159. ## A resolver supporting DNSSEC is recommended. This may become mandatory.
  160. ##
  161. ## People in China may need to use 114.114.114.114:53 here.
  162. ## Other popular options include 8.8.8.8 and 1.1.1.1.
  163.  
  164. fallback_resolver = '9.9.9.9:53'
  165.  
  166.  
  167. ## Never let dnscrypt-proxy try to use the system DNS settings;
  168. ## unconditionally use the fallback resolver.
  169.  
  170. ignore_system_dns = false
  171.  
  172.  
  173. ## Maximum time (in seconds) to wait for network connectivity before
  174. ## initializing the proxy.
  175. ## Useful if the proxy is automatically started at boot, and network
  176. ## connectivity is not guaranteed to be immediately available.
  177. ## Use 0 to disable.
  178.  
  179. netprobe_timeout = 30
  180.  
  181.  
  182. ## Automatic log files rotation
  183.  
  184. # Maximum log files size in MB
  185. log_files_max_size = 10
  186.  
  187. # How long to keep backup files, in days
  188. log_files_max_age = 7
  189.  
  190. # Maximum log files backups to keep (or 0 to keep all backups)
  191. log_files_max_backups = 1
  192.  
  193.  
  194.  
  195. #########################
  196. # Filters #
  197. #########################
  198.  
  199. ## Immediately respond to IPv6-related queries with an empty response
  200. ## This makes things faster when there is no IPv6 connectivity, but can
  201. ## also cause reliability issues with some stub resolvers.
  202. ## Do not enable if you added a validating resolver such as dnsmasq in front
  203. ## of the proxy.
  204.  
  205. block_ipv6 = false
  206.  
  207.  
  208.  
  209. ##################################################################################
  210. # Route queries for specific domains to a dedicated set of servers #
  211. ##################################################################################
  212.  
  213. ## Example map entries (one entry per line):
  214. ## example.com 9.9.9.9
  215. ## example.net 9.9.9.9,8.8.8.8,1.1.1.1
  216.  
  217. # forwarding_rules = 'forwarding-rules.txt'
  218.  
  219.  
  220.  
  221. ###############################
  222. # Cloaking rules #
  223. ###############################
  224.  
  225. ## Cloaking returns a predefined address for a specific name.
  226. ## In addition to acting as a HOSTS file, it can also return the IP address
  227. ## of a different name. It will also do CNAME flattening.
  228. ##
  229. ## Example map entries (one entry per line)
  230. ## example.com 10.1.1.1
  231. ## www.google.com forcesafesearch.google.com
  232.  
  233. # cloaking_rules = 'cloaking-rules.txt'
  234.  
  235.  
  236.  
  237. ###########################
  238. # DNS cache #
  239. ###########################
  240.  
  241. ## Enable a DNS cache to reduce latency and outgoing traffic
  242.  
  243. cache = true
  244.  
  245.  
  246. ## Cache size
  247.  
  248. cache_size = 4096
  249.  
  250.  
  251. ## Minimum TTL for cached entries
  252.  
  253. cache_min_ttl = 600
  254.  
  255.  
  256. ## Maximum TTL for cached entries
  257.  
  258. cache_max_ttl = 86400
  259.  
  260.  
  261. ## Minimum TTL for negatively cached entries
  262.  
  263. cache_neg_min_ttl = 60
  264.  
  265.  
  266. ## Maximum TTL for negatively cached entries
  267.  
  268. cache_neg_max_ttl = 600
  269.  
  270.  
  271.  
  272. ###############################
  273. # Query logging #
  274. ###############################
  275.  
  276. ## Log client queries to a file
  277.  
  278. [query_log]
  279.  
  280. ## Path to the query log file (absolute, or relative to the same directory as the executable file)
  281.  
  282. # file = 'query.log'
  283.  
  284.  
  285. ## Query log format (currently supported: tsv and ltsv)
  286.  
  287. format = 'tsv'
  288.  
  289.  
  290. ## Do not log these query types, to reduce verbosity. Keep empty to log everything.
  291.  
  292. # ignored_qtypes = ['DNSKEY', 'NS']
  293.  
  294.  
  295.  
  296. ############################################
  297. # Suspicious queries logging #
  298. ############################################
  299.  
  300. ## Log queries for nonexistent zones
  301. ## These queries can reveal the presence of malware, broken/obsolete applications,
  302. ## and devices signaling their presence to 3rd parties.
  303.  
  304. [nx_log]
  305.  
  306. ## Path to the query log file (absolute, or relative to the same directory as the executable file)
  307.  
  308. # file = 'nx.log'
  309.  
  310.  
  311. ## Query log format (currently supported: tsv and ltsv)
  312.  
  313. format = 'tsv'
  314.  
  315.  
  316.  
  317. ######################################################
  318. # Pattern-based blocking (blacklists) #
  319. ######################################################
  320.  
  321. ## Blacklists are made of one pattern per line. Example of valid patterns:
  322. ##
  323. ## example.com
  324. ## =example.com
  325. ## *sex*
  326. ## ads.*
  327. ## ads*.example.*
  328. ## ads*.example[0-9]*.com
  329. ##
  330. ## Example blacklist files can be found at https://download.dnscrypt.info/blacklists/
  331. ## A script to build blacklists from public feeds can be found in the
  332. ## `utils/generate-domains-blacklists` directory of the dnscrypt-proxy source code.
  333.  
  334. [blacklist]
  335.  
  336. ## Path to the file of blocking rules (absolute, or relative to the same directory as the executable file)
  337.  
  338. # blacklist_file = 'blacklist.txt'
  339.  
  340.  
  341. ## Optional path to a file logging blocked queries
  342.  
  343. # log_file = 'blocked.log'
  344.  
  345.  
  346. ## Optional log format: tsv or ltsv (default: tsv)
  347.  
  348. # log_format = 'tsv'
  349.  
  350.  
  351.  
  352. ###########################################################
  353. # Pattern-based IP blocking (IP blacklists) #
  354. ###########################################################
  355.  
  356. ## IP blacklists are made of one pattern per line. Example of valid patterns:
  357. ##
  358. ## 127.*
  359. ## fe80:abcd:*
  360. ## 192.168.1.4
  361.  
  362. [ip_blacklist]
  363.  
  364. ## Path to the file of blocking rules (absolute, or relative to the same directory as the executable file)
  365.  
  366. # blacklist_file = 'ip-blacklist.txt'
  367.  
  368.  
  369. ## Optional path to a file logging blocked queries
  370.  
  371. # log_file = 'ip-blocked.log'
  372.  
  373.  
  374. ## Optional log format: tsv or ltsv (default: tsv)
  375.  
  376. # log_format = 'tsv'
  377.  
  378.  
  379.  
  380. ######################################################
  381. # Pattern-based whitelisting (blacklists bypass) #
  382. ######################################################
  383.  
  384. ## Whitelists support the same patterns as blacklists
  385. ## If a name matches a whitelist entry, the corresponding session
  386. ## will bypass names and IP filters.
  387. ##
  388. ## Time-based rules are also supported to make some websites only accessible at specific times of the day.
  389.  
  390. [whitelist]
  391.  
  392. ## Path to the file of whitelisting rules (absolute, or relative to the same directory as the executable file)
  393.  
  394. # whitelist_file = 'whitelist.txt'
  395.  
  396.  
  397. ## Optional path to a file logging whitelisted queries
  398.  
  399. # log_file = 'whitelisted.log'
  400.  
  401.  
  402. ## Optional log format: tsv or ltsv (default: tsv)
  403.  
  404. # log_format = 'tsv'
  405.  
  406.  
  407.  
  408. ##########################################
  409. # Time access restrictions #
  410. ##########################################
  411.  
  412. ## One or more weekly schedules can be defined here.
  413. ## Patterns in the name-based blocklist can optionally be followed with @schedule_name
  414. ## to apply the pattern 'schedule_name' only when it matches a time range of that schedule.
  415. ##
  416. ## For example, the following rule in a blacklist file:
  417. ## *.youtube.* @time-to-sleep
  418. ## would block access to YouTube only during the days, and period of the days
  419. ## define by the 'time-to-sleep' schedule.
  420. ##
  421. ## {after='21:00', before= '7:00'} matches 0:00-7:00 and 21:00-0:00
  422. ## {after= '9:00', before='18:00'} matches 9:00-18:00
  423.  
  424. [schedules]
  425.  
  426. # [schedules.'time-to-sleep']
  427. # mon = [{after='21:00', before='7:00'}]
  428. # tue = [{after='21:00', before='7:00'}]
  429. # wed = [{after='21:00', before='7:00'}]
  430. # thu = [{after='21:00', before='7:00'}]
  431. # fri = [{after='23:00', before='7:00'}]
  432. # sat = [{after='23:00', before='7:00'}]
  433. # sun = [{after='21:00', before='7:00'}]
  434.  
  435. # [schedules.'work']
  436. # mon = [{after='9:00', before='18:00'}]
  437. # tue = [{after='9:00', before='18:00'}]
  438. # wed = [{after='9:00', before='18:00'}]
  439. # thu = [{after='9:00', before='18:00'}]
  440. # fri = [{after='9:00', before='17:00'}]
  441.  
  442.  
  443.  
  444. #########################
  445. # Servers #
  446. #########################
  447.  
  448. ## Remote lists of available servers
  449. ## Multiple sources can be used simultaneously, but every source
  450. ## requires a dedicated cache file.
  451. ##
  452. ## Refer to the documentation for URLs of public sources.
  453. ##
  454. ## A prefix can be prepended to server names in order to
  455. ## avoid collisions if different sources share the same for
  456. ## different servers. In that case, names listed in `server_names`
  457. ## must include the prefixes.
  458. ##
  459. ## If the `urls` property is missing, cache files and valid signatures
  460. ## must be already present; This doesn't prevent these cache files from
  461. ## expiring after `refresh_delay` hours.
  462.  
  463. [sources]
  464.  
  465. ## An example of a remote source from https://github.com/DNSCrypt/dnscrypt-resolvers
  466.  
  467. [sources.'public-resolvers']
  468. urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/public-resolvers.md', 'https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md']
  469. cache_file = 'public-resolvers.md'
  470. minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
  471. refresh_delay = 72
  472. prefix = ''
  473.  
  474. ## Another example source, with resolvers censoring some websites not appropriate for children
  475. ## This is a subset of the `public-resolvers` list, so enabling both is useless
  476.  
  477. # [sources.'parental-control']
  478. # urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/parental-control.md', 'https://download.dnscrypt.info/resolvers-list/v2/parental-control.md']
  479. # cache_file = 'parental-control.md'
  480. # minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
  481.  
  482.  
  483.  
  484. ## Optional, local, static list of additional servers
  485. ## Mostly useful for testing your own servers.
  486.  
  487. [static]
  488.  
  489. # [static.'google']
  490. # stamp = 'sdns://AgUAAAAAAAAAAAAOZG5zLmdvb2dsZS5jb20NL2V4cGVyaW1lbnRhbA'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement