Complete list of UK postcodes plus their city, county, uk country
OS Code-Point Open is probably the best you will get for free, and should provide you with all the data you need.
OS Open Names might be a better option as it has postcode, populated place (could be a city, town, village etc), unitary county, and country.
Note that these fields will not always be what you might expect though, especially unitary county.
Here is an example for postcode RG4 7LR:
- POPULATED_PLACE: Caversham
- COUNTY_UNITARY: Reading
- COUNTRY: England
I would recommend the National Statistics Postcode Lookup. It seems to be the official source.