I have written on the Gotras of Brahmins. Here is a List of Gotras of North India with name of Kula Devta,Family Deity. ‘ Suryavanshi UP & Uttranchal Kashyap Chandika … Continue reading Kshatriya Rajput Gotras North India List
And over a period of years Brahmins have started using their professions as their surnames ,as against the Hindu practice of using Sharma as their surname and for indentification their Pravara/Abhivadan Mantra.
So when one has a surname like Upadhyaya it merely denotes the profession and not a caste.
To find it one has to check the Pravara.