Skip to content

Commit dd25f30

Browse files
committed
Updated dnscrypt-proxy to 2.0.42
1 parent b81161e commit dd25f30

File tree

6 files changed

+89
-38
lines changed

6 files changed

+89
-38
lines changed
413 KB
Binary file not shown.
393 KB
Binary file not shown.

SimpleDnsCrypt/Models/DnscryptProxyConfiguration.cs

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public class DnscryptProxyConfiguration : PropertyChangedBase
4343
private int _log_files_max_age;
4444
private int _log_files_max_backups;
4545
private bool _block_ipv6;
46+
private bool _block_unqualified;
47+
private bool _block_undelegated;
4648
private int _reject_ttl;
4749
private string _forwarding_rules;
4850
private string _cloaking_rules;
@@ -52,7 +54,7 @@ public class DnscryptProxyConfiguration : PropertyChangedBase
5254
private int _cache_min_ttl;
5355
private int _cache_size;
5456
private bool _cache;
55-
private string _fallback_resolver;
57+
private ObservableCollection<string> _fallback_resolvers;
5658
private bool _ignore_system_dns;
5759
private Dictionary<string, Static> _static;
5860
private string _proxy;
@@ -489,24 +491,29 @@ public int cert_refresh_delay
489491
}
490492

491493
/// <summary>
492-
/// Fallback resolver
493-
/// This is a normal, non-encrypted DNS resolver, that will be only used
494-
/// for one-shot queries when retrieving the initial resolvers list, and
495-
/// only if the system DNS configuration doesn't work.
496-
/// No user application queries will ever be leaked through this resolver,
497-
/// and it will not be used after IP addresses of resolvers URLs have been found.
498-
/// It will never be used if lists have already been cached, and if stamps
499-
/// don't include host names without IP addresses.
500-
/// It will not be used if the configured system DNS works.
501-
/// A resolver supporting DNSSEC is recommended. This may become mandatory.
494+
/// Fallback resolvers
495+
/// These are normal, non-encrypted DNS resolvers, that will be only used
496+
/// for one-shot queries when retrieving the initial resolvers list, and
497+
/// only if the system DNS configuration doesn't work.
498+
/// No user application queries will ever be leaked through these resolvers,
499+
/// and they will not be used after IP addresses of resolvers URLs have been found.
500+
/// They will never be used if lists have already been cached, and if stamps
501+
/// don't include host names without IP addresses.
502+
/// They will not be used if the configured system DNS works.
503+
/// Resolvers supporting DNSSEC are recommended.
504+
///
505+
/// People in China may need to use 114.114.114.114:53 here.
506+
/// Other popular options include 8.8.8.8 and 1.1.1.1.
507+
///
508+
/// If more than one resolver is specified, they will be tried in sequence.
502509
/// </summary>
503-
public string fallback_resolver
510+
public ObservableCollection<string> fallback_resolvers
504511
{
505-
get => _fallback_resolver;
512+
get => _fallback_resolvers;
506513
set
507514
{
508-
_fallback_resolver = value;
509-
NotifyOfPropertyChange(() => fallback_resolver);
515+
_fallback_resolvers = value;
516+
NotifyOfPropertyChange(() => fallback_resolvers);
510517
}
511518
}
512519

@@ -578,6 +585,33 @@ public bool block_ipv6
578585
}
579586
}
580587

588+
/// <summary>
589+
/// Immediately respond to A and AAAA queries for host names without a domain name.
590+
/// </summary>
591+
public bool block_unqualified
592+
{
593+
get => _block_unqualified;
594+
set
595+
{
596+
_block_unqualified = value;
597+
NotifyOfPropertyChange(() => block_unqualified);
598+
}
599+
}
600+
601+
/// <summary>
602+
/// Immediately respond to queries for local zones instead of leaking them to
603+
/// upstream resolvers (always causing errors or timeouts).
604+
/// </summary>
605+
public bool block_undelegated
606+
{
607+
get => _block_undelegated;
608+
set
609+
{
610+
_block_undelegated = value;
611+
NotifyOfPropertyChange(() => block_undelegated);
612+
}
613+
}
614+
581615
/// <summary>
582616
/// TTL for synthetic responses sent when a request has been blocked (due to IPv6 or blacklists).
583617
/// </summary>

SimpleDnsCrypt/ViewModels/MainViewModel.cs

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,12 @@ public void Initialize()
460460
}
461461
}
462462

463-
if (DnscryptProxyConfiguration?.fallback_resolver != null)
463+
if (DnscryptProxyConfiguration?.fallback_resolvers != null)
464464
{
465-
FallbackResolver = DnscryptProxyConfiguration.fallback_resolver;
465+
if (DnscryptProxyConfiguration.fallback_resolvers.Count > 0)
466+
{
467+
FallbackResolvers = DnscryptProxyConfiguration.fallback_resolvers;
468+
}
466469
}
467470

468471
if (!string.IsNullOrEmpty(DnscryptProxyConfiguration?.cloaking_rules))
@@ -655,6 +658,11 @@ public void Proxies()
655658
}
656659
}
657660

661+
public async void ManageFallbackResolvers()
662+
{
663+
664+
}
665+
658666
public async void ListenAddresses()
659667
{
660668
dynamic settings = new ExpandoObject();
@@ -1226,15 +1234,15 @@ public bool IsUninstallingService
12261234

12271235
#endregion
12281236

1229-
private string _fallbackResolver;
1230-
public string FallbackResolver
1237+
private ObservableCollection<string> _fallbackResolvers;
1238+
public ObservableCollection<string> FallbackResolvers
12311239
{
1232-
get => _fallbackResolver;
1240+
get => _fallbackResolvers;
12331241
set
12341242
{
1235-
_fallbackResolver = value;
1236-
ValidateFallbackResolver();
1237-
NotifyOfPropertyChange(() => FallbackResolver);
1243+
_fallbackResolvers = value;
1244+
ValidateFallbackResolvers();
1245+
NotifyOfPropertyChange(() => FallbackResolvers);
12381246
}
12391247
}
12401248

@@ -1250,26 +1258,30 @@ public IEnumerable GetErrors(string propertyName)
12501258
public bool HasErrors => _validationErrors.Any();
12511259

12521260

1253-
private void ValidateFallbackResolver()
1261+
private void ValidateFallbackResolvers()
12541262
{
1255-
if (string.IsNullOrEmpty(_fallbackResolver))
1256-
{
1257-
_validationErrors.Add("FallbackResolver", "invalid");
1258-
}
1259-
else
1263+
var validatedFallbackResolvers = new ObservableCollection<string>();
1264+
foreach (var fallbackResolver in _fallbackResolvers)
12601265
{
1261-
var validatedFallbackResolver = ValidationHelper.ValidateIpEndpoint(_fallbackResolver);
1262-
if (!string.IsNullOrEmpty(validatedFallbackResolver))
1266+
if (string.IsNullOrEmpty(fallbackResolver))
12631267
{
1264-
_fallbackResolver = validatedFallbackResolver;
1265-
DnscryptProxyConfiguration.fallback_resolver = _fallbackResolver;
1266-
_validationErrors.Remove("FallbackResolver");
1268+
_validationErrors.Add("FallbackResolvers", "invalid");
12671269
}
12681270
else
12691271
{
1270-
_validationErrors.Add("FallbackResolver", "invalid");
1272+
var validatedFallbackResolver = ValidationHelper.ValidateIpEndpoint(fallbackResolver);
1273+
if (!string.IsNullOrEmpty(validatedFallbackResolver))
1274+
{
1275+
validatedFallbackResolvers.Add(validatedFallbackResolver);
1276+
_validationErrors.Remove("FallbackResolvers");
1277+
}
1278+
else
1279+
{
1280+
_validationErrors.Add("FallbackResolvers", "invalid");
1281+
}
12711282
}
12721283
}
1284+
DnscryptProxyConfiguration.fallback_resolvers = validatedFallbackResolvers;
12731285
}
12741286

12751287
#region Tray

SimpleDnsCrypt/Views/MainView.xaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,10 @@
844844
VerticalAlignment="Bottom"
845845
HorizontalAlignment="Left" Margin="0,0,0,5">
846846
</TextBlock>
847-
<TextBox
847+
<Button IsEnabled="{Binding IsWorkingOnService, Converter={StaticResource ReverseBoolToEnabledConverter}}" Width="Auto"
848+
Grid.Row="0" Grid.Column="1" Cursor="Hand" Content="{lex:Loc Key=address_settings_manage_fallback_resolvers}" x:Name="ManageFallbackResolvers" Margin="0,0,0,5"
849+
HorizontalAlignment="Right" Style="{DynamicResource CustomAccentedSquareButtonStyle}" VerticalAlignment="Top"></Button>
850+
<!--<TextBox
848851
IsEnabled="{Binding IsWorkingOnService, Converter={StaticResource ReverseBoolToEnabledConverter}}"
849852
Grid.Row="0" Grid.Column="1" Cursor="Hand" MinWidth="65" Width="Auto"
850853
Text="{Binding FallbackResolver}"
@@ -861,7 +864,7 @@
861864
</Grid>
862865
</ControlTemplate>
863866
</Validation.ErrorTemplate>
864-
</TextBox>
867+
</TextBox>-->
865868
</Grid>
866869
<!-- Fallback Resolver end -->
867870
<!-- Netprobe Timeout begin -->

SimpleDnsCrypt/dnscrypt-proxy/dnscrypt-proxy.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ force_tcp = false
1111
timeout = 5000
1212
keepalive = 30
1313
cert_refresh_delay = 240
14-
fallback_resolver = '9.9.9.9:53'
14+
fallback_resolvers = ['9.9.9.9:53', '8.8.8.8:53']
1515
ignore_system_dns = true
1616
netprobe_timeout = 60
1717
netprobe_address = '9.9.9.9:53'
1818
log_files_max_size = 10
1919
log_files_max_age = 7
2020
log_files_max_backups = 1
2121
block_ipv6 = true
22+
block_unqualified = true
23+
block_undelegated = true
2224
reject_ttl = 600
2325
cache = true
2426
cache_size = 1024

0 commit comments

Comments
 (0)