In very general terms, data transfer objects (DTOs) are structures that allow packing data when information is exchanged among applications or processes. While business objects or even entities own both state and behavior, DTOs should have only state. I personally see them as the apparel that the domain, the application’s “center of purity,” puts on when engaging in interactions with the “exterior.”
Java records, on the other hand, prove very useful when data-oriented structures are needed, as a lot of boilerplate code is removed.