This topic contains 6 replies, has 4 voices, and was last updated by Max Kozlov 8 months, 2 weeks ago.
-
AuthorPosts
-
August 8, 2017 at 2:42 pm #76938
Not for sure if I am over looking something but I have not been able to find a good way to verify that DNS entries are correct for my computers.
If anyone has an idea or has already done this and would like to share that would be awesome.I have all my computers in a text file from AD that I would like to verify that the DNS forward and reverse Lookup zones are correct based off of the DHCP lease.
We constant are unable to communicate with computers because DNS is pointing to the wrong address and was hoping for an easier and more proactive way to catch these before they are a problem. -
August 8, 2017 at 2:44 pm #76941
Well... at the risk of sounding snarky, I'd look for the source of the problem and fix that. I mean, you could certainly write a script to check DNS records, I suppose... but _why_ are they wrong? Is DDNS failing at the client or the DNS server? Why are server DHCP leases changing – normally, I'd expect a server to continually renew the same lease – are your DHCP scopes running out of addresses?
-
August 8, 2017 at 3:00 pm #76945
Wish I could fix the problem, unfortunately that is not possible. The beast is to big to tame atleast until it dies. I have no control over that choice so I am trying to fix what I can.
-
August 8, 2017 at 3:02 pm #76948
Sounds like you need a new job. Or at least tell the existing one, "no, we either fix the problem or we don't fix the problem, but you don't pay me to slap band-aids on things. I'm an engineer, not an EMT."
-
-
August 8, 2017 at 2:54 pm #76944
I agree with Don on fixing the issue rather than a sticking plaster approach. But if you want to script it have a look here. I would probably use the bottom one in the comments unless you are in a pure win 8 + environment
-
August 8, 2017 at 3:08 pm #76950
Thank you will look into it.
I guess I was just looking more for the script to report back in a xls file or something with the Computername, Reverse Lookup info, Forward lookup info, and DHCP address in the four columns. Maybe I explained it wrong in the original post
-
-
August 9, 2017 at 7:21 am #76984
while you search for better job you can use something like this 😉
$leases = Get-DhcpServerv4Lease -ScopeId $scopeid -ComputerName $dhcpserver foreach ($lease in $leases) { $hostname = $lease.HostName $ipAddress = $lease.IPAddress $dnsHostNameEntry = [System.Net.Dns]::Resolve($ipaddress) $dnsHostAddressEntry = [System.Net.Dns]::Resolve($ipaddress) # here you should test for emtiness in $dnsHostNameEntry, $dnsHostAddressEntry - its your homework if (($hostname -ne $dnshostnameentry.hostname)) -or ($dnsHostAddressEntry.AddressList.Count -gt 1) -or ( $ipAddress -notin $dnsHostAddressEntry.AddressList ) { Big Alert !!! } }
you should repeat it (with appropriate code corrections of course) for forward and reverse scopes
-
AuthorPosts
You must be logged in to reply to this topic.