Skip to content

Commit

Permalink
rc: change default behaviour of resolv.conf to use ISP instead of loc…
Browse files Browse the repository at this point in the history
…al cache

With the increased complexity involving DNS Privacy, ntpd and WAN monitoring,
it's safer (and more reliable) to have the router always use the ISP resolvers
by default.
  • Loading branch information
RMerl committed May 19, 2019
1 parent 8104802 commit de88069
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion release/src/router/rc/services.c
Expand Up @@ -1765,7 +1765,7 @@ void start_dnsmasq(void)

/* Update local resolving mode */
n = readlink("/etc/resolv.conf", buf, sizeof(buf));
if (nvram_get_int("dns_local")) {
if (nvram_get_int("dns_local_cache")) {
/* Use dnsmasq for local resolving if it did start,
* fallback to wan dns otherwise */
path = (char *)dmresolv;
Expand Down
2 changes: 1 addition & 1 deletion release/src/router/shared/defaults.c
Expand Up @@ -3107,7 +3107,7 @@ struct nvram_tuple router_defaults[] = {
{ "nat_type", "0", CKN_STR1, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 }, //0: Symmetric 1: Full cone
#endif
{ "dns_norebind", "0", CKN_STR1, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 }, // dnsmasq DNS rebind protection
{ "dns_local", "1", CKN_STR1, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 }, // use local dns as system resolver
{ "dns_local_cache", "0", CKN_STR1, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 }, // use local dns as system resolver

// miniupnpd - PCP-related values
{ "upnp_min_lifetime", "120", CKN_STR6, CKN_TYPE_DEFAULT, CKN_ACC_LEVEL_DEFAULT, CKN_ENC_DEFAULT, 0 },
Expand Down
8 changes: 4 additions & 4 deletions release/src/router/www/Tools_OtherSettings.asp
Expand Up @@ -560,7 +560,7 @@ function applyRule(){
}
}
if (getRadioValue(document.form.dns_local) != "<% nvram_get("dns_local"); %>")
if (getRadioValue(document.form.dns_local_cache) != "<% nvram_get("dns_local_cache"); %>")
document.form.action_script.value += ";restart_dnsmasq";
document.form.submit();
Expand Down Expand Up @@ -872,10 +872,10 @@ function done_validating(action){
</td>
</tr>
<tr>
<th><a class="hintstyle" href="javascript:void(0);" onClick="openHint(50,27);">Wan: Use local caching DNS server as system resolver (default: Yes)</a></th>
<th><a class="hintstyle" href="javascript:void(0);" onClick="openHint(50,27);">Wan: Use local caching DNS server as system resolver (default: No)</a></th>
<td>
<input type="radio" name="dns_local" class="input" value="1" <% nvram_match_x("", "dns_local", "1", "checked"); %>><#checkbox_Yes#>
<input type="radio" name="dns_local" class="input" value="0" <% nvram_match_x("", "dns_local", "0", "checked"); %>><#checkbox_No#>
<input type="radio" name="dns_local_cache" class="input" value="1" <% nvram_match_x("", "dns_local_cache", "1", "checked"); %>><#checkbox_Yes#>
<input type="radio" name="dns_local_cache" class="input" value="0" <% nvram_match_x("", "dns_local_cache", "0", "checked"); %>><#checkbox_No#>
</td>
</tr>
<tr>
Expand Down

0 comments on commit de88069

Please sign in to comment.