Sorting by IP address in the Windows 2008 R2 DNS utility
I was walking a client through DNS changes on their Windows 2008 R2 server today. They asked how to sort by ascending IP address assignment. I directed them to the "Data" column...
"It's not sorting right!!"
Oh? And then I took a look. It seems that the DNS utility sort prefers ASCII value order rather than the fourth octet's actual value. This also appears to be an issue with the architecture version, based on responses from the Technet forum.
This was confusing to the client, as he was used to administering a Windows 2003 system that did not exhibit this behavior. Is there a way to present this in a more elegant fashion?
Solution 1:
Assuming your clients aren't down with the Power of PowerShell, their only other option (given that Microsoft doesn't care to fix the search behavior) is to access the DNS records with a different client that sorts the way they want it.
One way is to export the list to a delimited text type and use Excel to sort the way they like (which is more effort than I'd care to invest).
The other way, that I'd probably prefer is to use a different client OS. You can use the DNS Manager to connect a remote server, and if the client in question is Server 2003, Windows XP, or Windows 7 32bit the search behavior is the type they're wanting. So, I would recommend spinning up a Windows 7, 32bit VM or workstation, installing the RSAT package on it, and directing your client to use this for DNS management purposes. Seems to me to be the easiest, least disruptive way to get your client what they want.
Solution 2:
You require the object-oriented power (!) of Powershell:
Get-DNSServerResourceRecord -ZoneName <ZoneName> | Sort-Object RecordData -Descending
Yielded me:
Disclaimer: I haven't gotten this to work for IP addresses with different first second or third octets, yet.