DORI distances come from pixel density (usually measured in PPF <pixels per feet> or PPM <pixels per meter>. This page does an OK job explaining it:
More pixels (i.e. 4MP vs 2MP) usually helps with DORI distances and I think help explains why the 4MP model has better DORI specs than the 2MP. Keep in mind that most folks here would recommend a PPF value of 100+ to ID someone you don't know. Dahua's DORI "Identify" distance is set for 80 PPF, if I recall correctly, so most here would consider them somewhat overstated. Another thing that can help DORI distances is the lens. 2.8mm lens usually have the lowest DORI values. As that number increases (i.e. 3.6-6mm), the DORI values should increase (with the tradeoff being that the image width decreases).
To get a rough idea of how cameras compare in low-light, one way is to compare their Min. Illumination lines from the spec sheets. The lower the number, usually the better the camera does in low light. So looking below, it seems like the 2231 should do noticeably better in low light.
2231 (1/2.8"): 0.002 Lux
2431 (1/3"): 0.008 Lux
In my opinion, the 2MP 1/2.8" image sensor, while older, was the best affordable low-light image sensor until a few months ago when the 4MP 1/1.8" image sensor came out. There are now some newer low-light image sensors (like this new 1/3" one in the 2431) that don't seem to do as well as the 2MP 1/2.8", but they're getting closer than they have before.