This statement is partially true.
Localhost name resolution can be handled within DNS itself through the use of DNS records such as the A record or AAAA record that map a domain name to an IP address. However, it is also possible for localhost name resolution to be handled locally on a device without involving DNS.
For example, on Windows systems, the local host file (located at C:\Windows\System32\drivers\etc\hosts) can be used to map domain names to specific IP addresses without requiring DNS resolution. This allows for faster and more efficient name resolution for frequently accessed resources.
In summary, while DNS can handle localhost name resolution, there are also other methods available that do not rely on DNS.