Red Hat Bugzilla – Bug 1459793
[RFE] IPA GUI sorts reverse DNS alphabetically rather than numerically
Last modified: 2018-02-06 15:05:05 EST
Description of problem:
PA GUI sorts reverse DNS alphabetically rather than numerically
Version-Release number of selected component (if applicable):
Steps to Reproduce:
adding reverse DNS zones in IPA GUI
When looking at reverse DNS zones in IPA GUI, it sorts the IP addresses (numeric) in an alphabetical order, leading to 1, 10, 100... rather than 1, 2, 3, ... 10, 11, ... and so on. This makes no sense. Reverse DNS zones, where the keys are numeric, should be sorted numerically.
to sort the zones in a numerical order
There is no guarantee that reverse zone records contains only numbers and PTR records. Reverse zone is just regular zone with special meaning and can contain everything that can contain master zone.
For example how to sort zone delegation records, classless reverse zone delegation?
@ SOA ............
10.10 NS nameserver.subzone.example.com.
0/26.20 NS nameserver.classless.zone.example.com.
1.1.1 PTR host.example.com.
1.128/26.20 PTR host2.example.com.
info TXT ":-)"
126.96.36.199.188.8.131.52.0.0.0.0.0.0.0.0 PTR host2.example.com.
184.108.40.206.4.7.c.f.0.0.0.0.0.0.0.0 PTR host2.example.com.
Ugly ^^ but possible.
I agree that numerical sort may be handy with usual zones with the only one number (not even case for IPv6 reverse zones) but we have to provide generic sorting that works in all cases and I'm not sure if there is something better than alphabetical sort.
This looks like wontfix for me, I don't think that is worth to create custom sorting for reverse zones (and any custom sort will have performance impact due splitting parts, converting types, etc. count with that zones are usually huge).
In addition to "what is the right sorting" question which Martin described, there is also implementation problem.
Web UI currently uses paging. For paging to work correctly, search results needs to be sorted on server side and not on Web UI side. If it would be sorted on WebUI side then it would sort only subset of records of a full list which is sorted by other algorithm. And therefore going to next page would return results from completely different part of the thought "properly sorted list".
So the options are:
1. use Web UI side sorting, but that would confuse users even more - would not behave as expected. Easy to implement.
2. use server side sorting - this is quite complex, must be done in Directory Server and involves special kind of indexes
3. disable paging, let result be limited by search size limit, sort the result on Web UI side. It is relatively doable with consistent results. But definitely not an easy fix.
Given that numerical sorting doesn't work for some situations and the complexity of implementation I don't think it is worth implementing.