I believe it shows distances to ships and non-celestial/non-structure/non-station entities when you’re on the same grid.
Otherwise, if you’re on nearby but separate grids (eg on a mission) simply use the results of a 1 AU D-Scan distance as a proxy to whose is invading your mission site. Or, make a 1-hour bookmark on the prior gate and point the 5 degree cone in the bookmark direction. Usual rules still apply (ex: recon & cloaked).
I’m under the impression D-Scan doesn’t list a range number by default since that would make it pretty clear which clump of celestials your target is hanging around. You can get the same information from a few D-Scans though with varied distance & cone shapes.
Dscan shows the distance only when the distance is already known.
You already know the distance to structures and the distance to ships on grid, so those distances will be listed in the Dscan window. Other distances are for you to find.
One trick to find an unknown distance is to scroll with big steps through the dscan distances while repeatedly using dscan. When you know a ship is somewhere between 5 and 10 AU, you can scroll in smaller increments until you find the ship is somewhere between 7.2 and 7.3 AU. Next, you open the Solar System window and switch between 7.2 and 7.3 AU dscan range, while having the anomalies shown. You now see two anomalies at that range, so you switch to 7.3 AU Dscan range with with an angle of 5 degrees, check both anomalies and see the Ishtar is ratting in the Blood Haven with signature DIU. You tell your fleet and you all warp to that anomaly and blow him up.
If Dscan automatically told you the distance, this would be a little too easy.
You only need probes if your target is at a safe spot or cosmic signature that needs to be scanned down.
You can use the distance reduction method others have described. Or you can scan once at max range and quickly cycle through celestials using 5 degree scan.
The hot key for dscan is V. If you hold V and click on singing in the overview, you will scan in that direction within 5 degrees. You can quickly click though the list to find your target that way as well.
Both approaches are very useful. And both work while still under gate cloak.
DScan will show distance for celestials and Stations/Structures. For deployables, POS, and ships, you need to either combat probe, or change the distance of your DScan until they are no longer on scan.