1*6777b538SAndroid Build Coastguard Worker# Adding/Modifying DoH providers 2*6777b538SAndroid Build Coastguard Worker 3*6777b538SAndroid Build Coastguard WorkerChrome performs autoupgrade of Classic DNS resolvers to equivalent same-provider 4*6777b538SAndroid Build Coastguard WorkerDoH servers using the mapping encoded in 5*6777b538SAndroid Build Coastguard Worker[`DohProviderEntry::GetList()`](/net/dns/public/doh_provider_entry.cc). 6*6777b538SAndroid Build Coastguard Worker 7*6777b538SAndroid Build Coastguard Worker[TOC] 8*6777b538SAndroid Build Coastguard Worker 9*6777b538SAndroid Build Coastguard Worker## Requesting provider list changes 10*6777b538SAndroid Build Coastguard Worker 11*6777b538SAndroid Build Coastguard WorkerOfficial representatives of a DoH provider can request the addition of or 12*6777b538SAndroid Build Coastguard Workermodifications to the entry for their service. See the 13*6777b538SAndroid Build Coastguard Worker[separate documentation](https://docs.google.com/document/d/128i2YTV2C7T6Gr3I-81zlQ-_Lprnsp24qzy_20Z1Psw) 14*6777b538SAndroid Build Coastguard Workerfor the criteria and process. 15*6777b538SAndroid Build Coastguard Worker 16*6777b538SAndroid Build Coastguard WorkerAfter following the process, if approved, the addition or modification will be 17*6777b538SAndroid Build Coastguard Workermade by a member of the Chromium team. 18*6777b538SAndroid Build Coastguard Worker 19*6777b538SAndroid Build Coastguard Worker## Modifying the DoH provider list 20*6777b538SAndroid Build Coastguard Worker 21*6777b538SAndroid Build Coastguard Worker*** note 22*6777b538SAndroid Build Coastguard WorkerAll modifications to the DoH provider list must be accompanied by a request in 23*6777b538SAndroid Build Coastguard Workerthe Chromium bug tracker in the 24*6777b538SAndroid Build Coastguard Worker[DoH component](https://bugs.chromium.org/p/chromium/issues/list?q=component:Internals%3ENetwork%3EDoH), 25*6777b538SAndroid Build Coastguard Workerand that request must be approved by the Chrome team. 26*6777b538SAndroid Build Coastguard Worker 27*6777b538SAndroid Build Coastguard WorkerIt is generally expected that the actual code change will be performed by the 28*6777b538SAndroid Build Coastguard WorkerChrome team on approval of the request. 29*6777b538SAndroid Build Coastguard Worker*** 30*6777b538SAndroid Build Coastguard Worker 31*6777b538SAndroid Build Coastguard Worker1. Ensure the request bug has been approved with a comment from a member of the 32*6777b538SAndroid Build Coastguard Worker Chrome team indicating the approval in the bug. Confirm whether the approved 33*6777b538SAndroid Build Coastguard Worker request is for an autoupgrade mapping, inclusion in the Chrome "Secure DNS" 34*6777b538SAndroid Build Coastguard Worker settings UI, or both. 35*6777b538SAndroid Build Coastguard Worker 36*6777b538SAndroid Build Coastguard Worker It is not necessary for the author or reviewer of the CL modifying the 37*6777b538SAndroid Build Coastguard Worker provider list to verify any aspects of the provider criteria, including 38*6777b538SAndroid Build Coastguard Worker ownership of hostnames. That is the responsibility of the Chrome team member 39*6777b538SAndroid Build Coastguard Worker who approved the request bug. 40*6777b538SAndroid Build Coastguard Worker1. Add or modify the [`DohProviderEntry`](/net/dns/public/doh_provider_entry.h) 41*6777b538SAndroid Build Coastguard Worker entry in 42*6777b538SAndroid Build Coastguard Worker [`DohProviderEntry::GetList()`](/net/dns/public/doh_provider_entry.cc). 43*6777b538SAndroid Build Coastguard Worker * `provider` is a unique string label used to identify the specific entry. 44*6777b538SAndroid Build Coastguard Worker It may be used for provider-specific metrics data sent to Google. The 45*6777b538SAndroid Build Coastguard Worker `provider` string should be camelcase, and for cases where a single 46*6777b538SAndroid Build Coastguard Worker organization runs multiple servers/varieties, the overall organization 47*6777b538SAndroid Build Coastguard Worker name should go before the variety-specific name. For example, if 48*6777b538SAndroid Build Coastguard Worker ExampleOrg has both filtered and unfiltered servers, they may have two 49*6777b538SAndroid Build Coastguard Worker provider list entries with the `provider` strings "ExampleOrgFiltered" 50*6777b538SAndroid Build Coastguard Worker and "ExampleOrgUnfiltered". 51*6777b538SAndroid Build Coastguard Worker * `feature` is used by experiments to control an individual provider. When 52*6777b538SAndroid Build Coastguard Worker the feature is disabled, either by default or remotely by an experiment 53*6777b538SAndroid Build Coastguard Worker config, the provider is not eligible for autoupgrade and it will not be 54*6777b538SAndroid Build Coastguard Worker listed in the "Secure DNS" settings. 55*6777b538SAndroid Build Coastguard Worker * `ip_addresses` is the list of Classic DNS server IP addresses that are 56*6777b538SAndroid Build Coastguard Worker eligible for upgrade to the provider\'s DoH server. The addresses do not 57*6777b538SAndroid Build Coastguard Worker need to be unique within the overall provider list. If multiple DoH 58*6777b538SAndroid Build Coastguard Worker provider entries contain the same `ip_addresses` entry, the DoH servers 59*6777b538SAndroid Build Coastguard Worker for all containing provider entries could become available for use if 60*6777b538SAndroid Build Coastguard Worker Chrome detects that IP address configured. `ip_addresses` may also be 61*6777b538SAndroid Build Coastguard Worker empty if a provider is only available in "Secure DNS" settings and not 62*6777b538SAndroid Build Coastguard Worker for autoupgrade. 63*6777b538SAndroid Build Coastguard Worker * `dns_over_tls_hostnames` is used for autoupgrade from DoT to DoH. May 64*6777b538SAndroid Build Coastguard Worker be used on platforms where Chrome can recognize configured DoT servers. 65*6777b538SAndroid Build Coastguard Worker Similar to `ip_addresses` in that it may be empty or non-unique. Note 66*6777b538SAndroid Build Coastguard Worker that addition/modification requests in the bug tracker often forget to 67*6777b538SAndroid Build Coastguard Worker mention DoT hostnames, so be sure to ask about it if you suspect a DoH 68*6777b538SAndroid Build Coastguard Worker provider may have an equivalent DoT endpoint. 69*6777b538SAndroid Build Coastguard Worker * `dns_over_https_template` is the URI template of the DoH server. It is 70*6777b538SAndroid Build Coastguard Worker formatted according to [RFC6570](https://tools.ietf.org/html/rfc6570) 71*6777b538SAndroid Build Coastguard Worker and [RFC8484](https://tools.ietf.org/html/rfc8484). If the template 72*6777b538SAndroid Build Coastguard Worker contains a single `dns` variable, Chrome will perform GET requests, and 73*6777b538SAndroid Build Coastguard Worker if the template contains no variables, Chrome will perform POST 74*6777b538SAndroid Build Coastguard Worker requests. Confirm this matches with the provider's GET/POST preference 75*6777b538SAndroid Build Coastguard Worker in the bug tracker request. 76*6777b538SAndroid Build Coastguard Worker * `ui_name` is the name that will be displayed to users in the "Secure 77*6777b538SAndroid Build Coastguard Worker DNS" settings. It is only needed for providers that will be listed in 78*6777b538SAndroid Build Coastguard Worker the settings. Confirm that the name conforms to the rules in the 79*6777b538SAndroid Build Coastguard Worker [criteria document](https://docs.google.com/document/d/128i2YTV2C7T6Gr3I-81zlQ-_Lprnsp24qzy_20Z1Psw/edit#heading=h.l3wtx3cufz78). 80*6777b538SAndroid Build Coastguard Worker 81*6777b538SAndroid Build Coastguard Worker ***promo 82*6777b538SAndroid Build Coastguard Worker Note that all `ui_name` values are currently ASCII-only strings. While 83*6777b538SAndroid Build Coastguard Worker non-ASCII names make sense, especially for region-specific providers, 84*6777b538SAndroid Build Coastguard Worker and there is no known issue with using such names, support has not been 85*6777b538SAndroid Build Coastguard Worker thoroughly tested. If adding a non-ASCII name, take extra care to test 86*6777b538SAndroid Build Coastguard Worker that it displays correctly in settings UIs for all platforms. 87*6777b538SAndroid Build Coastguard Worker *** 88*6777b538SAndroid Build Coastguard Worker * `privacy_policy` is a URL to the privacy policy page for the provider. 89*6777b538SAndroid Build Coastguard Worker It is only needed for providers that will be listed in the settings. 90*6777b538SAndroid Build Coastguard Worker * `display_globally` sets whether or not a provider will appear in the 91*6777b538SAndroid Build Coastguard Worker "Secure DNS" settings globally for all users. This flag is only expected 92*6777b538SAndroid Build Coastguard Worker to be set for a small number of providers. 93*6777b538SAndroid Build Coastguard Worker * `display_countries` sets any specific countries in which the provider 94*6777b538SAndroid Build Coastguard Worker should appear in "Secure DNS" settings. Should be empty if 95*6777b538SAndroid Build Coastguard Worker `display_globally` is set. Format is the two-letter ISO 3166-1 country 96*6777b538SAndroid Build Coastguard Worker codes. The provider will be displayed to users when the OS region 97*6777b538SAndroid Build Coastguard Worker settings consider the OS to be in one of the given countries. 98*6777b538SAndroid Build Coastguard Worker * `logging_level` should be set to `kExtra` for any entry for which 99*6777b538SAndroid Build Coastguard Worker logging/monitoring/etc is especially important. This should be the case 100*6777b538SAndroid Build Coastguard Worker only for the couple most-used providers in the list, newly-entered 101*6777b538SAndroid Build Coastguard Worker providers with some risk of issues, or providers with a history of 102*6777b538SAndroid Build Coastguard Worker issues requiring that provider to be disabled for auto upgrade. 103*6777b538SAndroid Build Coastguard Worker1. Manually test the new addition/modification. 104*6777b538SAndroid Build Coastguard Worker *** promo 105*6777b538SAndroid Build Coastguard Worker If running tests on enterprise-maintained machines, DoH may be disabled, 106*6777b538SAndroid Build Coastguard Worker leading to DoH tests always failing and the "Secure DNS" settings being 107*6777b538SAndroid Build Coastguard Worker disabled. In such cases, a strategic local-only modification to 108*6777b538SAndroid Build Coastguard Worker [`StubResolverConfigReader`](/chrome/browser/net/stub_resolver_config_reader.cc) 109*6777b538SAndroid Build Coastguard Worker may be necessary to bypass the disabling. 110*6777b538SAndroid Build Coastguard Worker *** 111*6777b538SAndroid Build Coastguard Worker 112*6777b538SAndroid Build Coastguard Worker * After making any additions or modifications to the provider list, run 113*6777b538SAndroid Build Coastguard Worker the DoH browser tests: 114*6777b538SAndroid Build Coastguard Worker ```shell 115*6777b538SAndroid Build Coastguard Worker browser_tests.exe --run-manual \ 116*6777b538SAndroid Build Coastguard Worker --gtest_filter= DohBrowserParameterizedTest/DohBrowserTest.* 117*6777b538SAndroid Build Coastguard Worker ``` 118*6777b538SAndroid Build Coastguard Worker Investigate any failures, especially concerning the modified 119*6777b538SAndroid Build Coastguard Worker provider(s). 120*6777b538SAndroid Build Coastguard Worker 121*6777b538SAndroid Build Coastguard Worker For new providers, repeat the test 25-100 times (exercise judgment on 122*6777b538SAndroid Build Coastguard Worker how much scrutiny is necessary) for the specific provider to ensure the 123*6777b538SAndroid Build Coastguard Worker provider is reliable: 124*6777b538SAndroid Build Coastguard Worker ```shell 125*6777b538SAndroid Build Coastguard Worker browser_tests.exe --run-manual \ 126*6777b538SAndroid Build Coastguard Worker --gtest_filter= DohBrowserParameterizedTest/DohBrowserTest.MANUAL_ExternalDohServers/PROVIDER_ID_HERE \ 127*6777b538SAndroid Build Coastguard Worker --gtest_repeat=100 128*6777b538SAndroid Build Coastguard Worker ``` 129*6777b538SAndroid Build Coastguard Worker 130*6777b538SAndroid Build Coastguard Worker * If adding/modifying a provider intended for display in "Secure DNS" 131*6777b538SAndroid Build Coastguard Worker settings, load up the settings page and select/deselect the provider 132*6777b538SAndroid Build Coastguard Worker followed by making some simple test requests to ensure it functions 133*6777b538SAndroid Build Coastguard Worker correctly. 134*6777b538SAndroid Build Coastguard Worker 135*6777b538SAndroid Build Coastguard Worker If the provider is only intended to be displayed in specific countries, 136*6777b538SAndroid Build Coastguard Worker test the settings inside and outside those countries by modifying the OS 137*6777b538SAndroid Build Coastguard Worker region settings and ensuring the entry only displays for the correct 138*6777b538SAndroid Build Coastguard Worker regions. On Windows 10, this setting is found under 139*6777b538SAndroid Build Coastguard Worker "Time & Language" > "Region" > "Country or region" 140*6777b538SAndroid Build Coastguard Worker 141*6777b538SAndroid Build Coastguard Worker *** aside 142*6777b538SAndroid Build Coastguard Worker TODO: Document region settings for other operating systems. 143*6777b538SAndroid Build Coastguard Worker *** 144*6777b538SAndroid Build Coastguard Worker1. Send the list modification code review to a reviewer in 145*6777b538SAndroid Build Coastguard Worker [DNS OWNERS](/net/dns/OWNERS), or if no DNS owners are available, to a 146*6777b538SAndroid Build Coastguard Worker reviewer in [net OWNERS](/net/OWNERS). The reviewer should confirm that the 147*6777b538SAndroid Build Coastguard Worker process defined in this document has been followed, especially that the bug 148*6777b538SAndroid Build Coastguard Worker tracker request has been properly approved. 149*6777b538SAndroid Build Coastguard Worker1. If a provider must be initially disabled or partially disabled, e.g. because 150*6777b538SAndroid Build Coastguard Worker a provider with significant usage has requested a gradual controlled 151*6777b538SAndroid Build Coastguard Worker rollout, a Googler must: 152*6777b538SAndroid Build Coastguard Worker * Create a launch bug, e.g. the [Cox DoH provider launch 153*6777b538SAndroid Build Coastguard Worker bug](https://crbug.com/1303146). 154*6777b538SAndroid Build Coastguard Worker * Create a Finch config to roll out each DoH provider, e.g. 155*6777b538SAndroid Build Coastguard Worker `DnsOverHttpsCox.gcl`. 156*6777b538SAndroid Build Coastguard Worker * Ensure that the provider's `DohProviderEntry::feature` is disabled by 157*6777b538SAndroid Build Coastguard Worker default and is enabled by the Finch config. 158*6777b538SAndroid Build Coastguard Worker * Before landing the Finch config, make the corresponding changes in 159*6777b538SAndroid Build Coastguard Worker [fieldtrial_testing_config.json](/testing/variations/fieldtrial_testing_config.json). 160*6777b538SAndroid Build Coastguard Worker * Once the DoH provider's feature has been launched and the Finch 161*6777b538SAndroid Build Coastguard Worker experiment has expired, `DohProviderEntry::feature` should be enabled 162*6777b538SAndroid Build Coastguard Worker by default. 163*6777b538SAndroid Build Coastguard Worker 164*6777b538SAndroid Build Coastguard Worker## Dynamic control 165*6777b538SAndroid Build Coastguard Worker 166*6777b538SAndroid Build Coastguard WorkerDoH providers, especially new ones, may have service interruptions or 167*6777b538SAndroid Build Coastguard Workerperformance degradation to the point that it's necessary to disable their 168*6777b538SAndroid Build Coastguard Workerautoupgrade feature. 169*6777b538SAndroid Build Coastguard Worker 170*6777b538SAndroid Build Coastguard WorkerIf the malfunctioning DoH provider is still in the middle of a gradual rollout, 171*6777b538SAndroid Build Coastguard WorkerGooglers may dynamically disable the provider by modifying its experiment config 172*6777b538SAndroid Build Coastguard Worker(`DnsOverHttps${ProviderName}.gcl`). 173*6777b538SAndroid Build Coastguard Worker 174*6777b538SAndroid Build Coastguard WorkerOtherwise, if the provider's autoupgrade feature has already been launched, 175*6777b538SAndroid Build Coastguard WorkerGooglers should create a new "kill switch config" rather than reuse the expired 176*6777b538SAndroid Build Coastguard Workergradual rollout config. Follow the guidance at 177*6777b538SAndroid Build Coastguard Worker[go/finch-killswitch](http://go/finch-killswitch). 178*6777b538SAndroid Build Coastguard Worker 179*6777b538SAndroid Build Coastguard Worker*** aside 180*6777b538SAndroid Build Coastguard WorkerIf a user has selected a provider via the "Secure DNS" settings and that 181*6777b538SAndroid Build Coastguard Workerprovider becomes disabled, the UI option will disappear from the dropdown but 182*6777b538SAndroid Build Coastguard Workerselection will convert to a custom text-box entry for the same provider and 183*6777b538SAndroid Build Coastguard Workercontinue to be used for that user. 184*6777b538SAndroid Build Coastguard Worker*** 185