From cfed453bf588dbdebc83c5801b0dc39ea9d03e5c Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 16 Mar 2024 13:23:53 +0530 Subject: [PATCH] DhcpServer: Updated default scope to use IgnoreClientIdentifierOption option. Updated dhcp log with more details in UpdateDnsAuthZone(). --- DnsServerCore/Dhcp/DhcpServer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DnsServerCore/Dhcp/DhcpServer.cs b/DnsServerCore/Dhcp/DhcpServer.cs index dd14ede9..1f26b404 100644 --- a/DnsServerCore/Dhcp/DhcpServer.cs +++ b/DnsServerCore/Dhcp/DhcpServer.cs @@ -105,6 +105,7 @@ namespace DnsServerCore.Dhcp scope.UseThisDnsServer = true; scope.DomainName = "home"; scope.LeaseTimeDays = 1; + scope.IgnoreClientIdentifierOption = true; SaveScopeFile(scope); } @@ -791,10 +792,12 @@ namespace DnsServerCore.Dhcp { foreach (DnsResourceRecord existingRecord in existingRecords) { - if (!(existingRecord.RDATA as DnsARecordData).Address.Equals(address)) + IPAddress existingAddress = (existingRecord.RDATA as DnsARecordData).Address; + if (!existingAddress.Equals(address)) { //a DNS record already exists for the specified domain name with a different address //do not change DNS record for this dynamic lease + _log?.Write("DHCP Server cannot update DNS: an A record already exists for '" + domain + "' with a different IP address [" + existingAddress.ToString() + "]."); return; } }