I think one reason you're having a hard time tracking down the right nut, and others often do too, is because you're sizing it incorrectly.
Nut and bolt specifications refer to the diameter of the thread, and the pitch of the threads, not the distance across the flats. Different types of bolts can have different head sizes, but thread dia and pitch will remain constant.
In metric, which is what's on pretty much any modern car, you'd measure the diameter of the shaft and then measure the distance between each thread. You can get special gauges to do that for cheap, but in this particular instance you'll probably be OK to measure off a 10mm section and count how many threads are in it. then divide that number into 10 and that's your pitch.
You'd specify it as (example, but probably close)M24x3 or M24x2.
M indicates Metric
24 indicates the thread diameter
3 indicates the pitch.
On an imperial bolt, it is similar, but instead of specifying the pitch between threads, you specify threads per inch. i.e. 3/8-16 (3/8 diameter, 16 threads per inch)
Once you have that info, it's just a matter of going to your fastener source and telling them what you need. For something as important as an axle nut, you're not going to want whatever they have in the bin at Lowes. You have to get the
correct grade.