byname

ˈbʌɪneɪm

noun

a nickname, especially one given to distinguish a person from others with the same given name.

surnames started off as bynames to distinguish two persons in the same locality