Is fernando's last name diaz then,not alonso?
Spaniards have two surnames: the surname of the father in first place and the surname of the mother in second place.
So the name is: Fernando
The first surname is: Alonso (surname of the father)
The second surname is: Díaz (surname of the mother)
Now the law has changed, and every couple having a baby can change the order of the surname (mother's surname being first and father's surname being second) if they want.
In order to shorten the names, Spaniards usually just say: "I'm Fernando Alonso", but for legal matters you have to use both surnames: "I, Fernando Alonso Díaz, with the National Document of Identity number X, declare that..."
Sometimes, the surname of the mother is more 'famous' than the surname of the father. For example: The prime minister of Spain, José Luis Rodríguez Zapatero is known in Spain as 'Zapatero' and not 'Rodriguez' (which is a very common surname in Spain), or the Spanish poet Federico García Lorca is known as 'Lorca' and not 'García' (which is also a very common surname).