10

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.

enter image description here

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?

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • 1
    It is likely based on 2008 supporteind IPV6 and then srting get a little complicated.... when you mix them ;) – TomTom Mar 17 '14 at 15:06
  • Natively, in Windows, or are proper IPAM tools allowed? – HopelessN00b Mar 17 '14 at 15:09
  • 1
    Export to Excel...sort. – TheCleaner Mar 17 '14 at 15:11
  • When I open the DNS tool on my Win7SP1 box, I don't seem to have the same issue. the .1xx are after .99, not after .11. The "Help-About DNS" pop up has version 6.1.7601.17514 – ETL Mar 17 '14 at 15:13
  • @ETL Well, aren't you the lucky one? It's [definitely a problem](http://social.technet.microsoft.com/Forums/windowsserver/en-US/f1b686ad-824f-4c16-a66c-f9470a2dfa6d/2008-dns-ip-address-sorting-issue?forum=winserverManagement) for... well, [everyone else](http://social.technet.microsoft.com/Forums/windowsserver/en-US/c49f7f79-54ad-473a-86a2-c04968eacc0b/2008r2-numeric-fields-sort-incorrectly-in-dns-mmc?forum=winserverManagement), and not one Microsoft seems to care to fix. How are your regional and language settings defined in the Control Panel? – HopelessN00b Mar 17 '14 at 15:20
  • @ETL - 32 bit? Because it seems to be sorting like you mention from what I've read if you access the DNS MMC from a 32 bit box. – TheCleaner Mar 17 '14 at 15:22
  • @ETL not sure why its not affecting you. I'm running DNS on Windows 2012 DCs, connecting with admin tools on a windows 8.1 client (help -> about DNS gives me 6.3.9600.16384) and I can see the problem. – Rob Moir Mar 17 '14 at 15:22
  • @TheCleaner - yes, 32bit Win7SP1 is what I used to pull up the DNS. – ETL Mar 17 '14 at 16:45
  • @HopelessN00b - yep, I'm lucky like that :) Regional settings are English United States unmodifed. – ETL Mar 17 '14 at 16:46
  • @ETL, yup it's the old way on 32 bit Windows 7. Odd. – HopelessN00b Mar 17 '14 at 16:58

2 Answers2

11

You require the object-oriented power (!) of Powershell:

Get-DNSServerResourceRecord -ZoneName <ZoneName> | Sort-Object RecordData -Descending 

Yielded me:

enter image description here

Disclaimer: I haven't gotten this to work for IP addresses with different first second or third octets, yet.

MDMoore313
  • 5,581
  • 6
  • 36
  • 75
  • 4
    That's because you'll need to [`Update-TypeData` for the .NET System.Net.IPAddress object](http://rkeithhill.wordpress.com/2007/06/23/sorting-ipaddresses-the-powershell-way/) to include support for a big endian property representing the IP. – jscott Mar 17 '14 at 16:06
7

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.

enter image description here

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
  • +1, but if your client doesn't want to harness the ***power*** of Powershell, do you really want them as a client..... – MDMoore313 Mar 17 '14 at 18:48
  • 2
    @MDMoore313 Ask Ed. But sure, I'd happily charge someone a couple grand to set up RSAT and DNS manager on a 32 bit Windows 7 VM. – HopelessN00b Mar 17 '14 at 18:53
  • Can't say no to that. – MDMoore313 Mar 17 '14 at 18:56
  • 1
    @HopelessN00b - I *really* need to get into consulting... –  Mar 17 '14 at 19:28
  • @kce It really comes down to your tolerance for stupid people and the mind-numbing, soul-crushing requests they tend to make of you. 2 grand for spinning up a VM sounds like a great deal, until you factor in the three weeks of dealing with someone who literally thinks this is the most important thing in the world, and the inevitable follow-up requests/problems. `Oh, thanks for fixing that DNS sort thing for me... but now the network's down. ... Yeah, I changed the DNS records. I organized them because they were disorganized. What does that have to do with anything? ... Well, fix it, ASAP.` – HopelessN00b Mar 23 '14 at 04:55