The male Y chromsome passes down unchanged from father to son.
In fact the Y chromosome can go unchanged for hundreds of generations. It will remain the the same haplotype for brothers and cousins for a thousand years. If there is a change you can still trace your ancestry because the change will add or delete just one repetition from the genetic code.
So, the last name might change or vary but not the geneology.