Update Hostname from CSV

I have a csv which contains hostname and IP address

Is there a way to update the hostname for each IP in the csv file

name,ip
host1,10.10.10.2
host2,10.10.10.3
host3,10.10.10.4

The csv file contains oveer 2,000 hosts names and the IP address, so not something I can do manualy.