You need a recorder that: 1) Has a microphone (or microphones) that will be able to handle those sound levels without clipping and 2) A system that will let you control the input level, so you can fine-tune it for a specific situation sound level-wise.
As you have noticed, handling those levels of amplitude is not something every system can do. You need something that can handle high amplitude levels mechanically (the mic), electrically (preamps), and digitally (converters, software). Otherwise you will get distortion.
Other things to look for is signal processing like parallel recording and compression/limiting. These might actually be required depending on how formal/serious your recording is.
Parallel recording will let you record in two tracks at the same time, one of which is set -XdB lower than the other (usually -6dB or more), so if one track clips you have the other as backup. You can then in post-production mix between both, or only use the one that didn't clip, or whatever you need. It gives you options.
Compression/limiting will let you handle the peaks of the input audio. It will limit how high the peaks can go, preventing them from reaching a clipping point (above 0dBFS in digital).
As you can see, avoiding clipping at all costs (at least the kind of clipping that sounds horrible) is the name of the game, so there are systems out there that will include all these features and tools, and some more (like stereo or surround recording).
In general, good portable recording systems will have some or all of these features, the best ones having even more. Zoom and Tascam are the most popular choices, but you have many options from a wide price range. Some examples:
Zoom H1, H4n, H5, H6, H2n
Tascam DR-05, DR-07, DR-40
Roland R-05, R-26
Here are more portable recorders.
Things to look at:
Inputs and mics. Will I only need the mics included in the system? Will I be able to use other microphones if I wanted to? You might want phantom power for condenser mics. See for example the Yamaha PR7, it only has one input and it is a TS, so you won't be able to run a balanced microphone XLR signal into it. If you are going to use external mics, maybe you want to avoid that one.
Signal processing. Which tools the system offers? Compression/limiting and parallel recording are very useful (again, maybe required depending on how formal and serious you are about recording). There are many more, some have editing possibilities and/or guitar amp modeling, and/or reverb, delay, etc. I really like the Tascam DR-40 in that sense, it offers both limiting and parallel recording (they call it dual recording).
If you are going to use the included mics, the quality of the included mics is important. Be sure that you like the included mics. Here is a comparison of the included mics of many portable recorders.
Here is a review of some of the most popular recorders.
Loud concerts and jams can get really loud.
The included mics on these systems might not be able to handle very loud sound levels. You might need to use another mic that can handle higher amplitudes (a dynamic mic, most likely). It all depends on how loud is your scenario. Loud as in a band rehearsal in a garage or studio? Or Loud as in an stadium concert? You might need to make some adjustments regarding the mic in very high amplitude scenarios.