First of all, we’d like to state that there is no specific tradition of last name among Muslims. Sometimes people take the last name of the family (Qurashi, Hashimi), sometimes they take their last name from their profession (Qassab, Najjar), sometimes they take their last name from the city in which they are born (Makki, Madani, Shami, Masri) and many other ways. The proper way in Islam is that the person should be known by his/her name and the name of his/her biological father.
From the Shari`ah perspective, everyone should take his biological father’s name and no one is allowed to have a father’s name other than his own biological father.
As for the surname or the last name, people mostly used to have their father’s family name. However, this issue (surname) is not to be arranged by Shari`ah. It differs from one country to another and from one culture to another. It is known for example that some women used to have their husband’s surname and this is a common practice in many communities.
In brief, we have to differentiate between two points:
First, the father name which should be the name of the biological father and no one is allowed to change the name of his biological father. So, matters such as inheritance, lineage, etc. can be fixed and set in order.
Second, as for the surname or last name, it differs from country to another and from one culture to another. It is not that serious issue like the father’s name.