I did this a number of years ago following this article on TechNet:
https://social.technet.microsoft.com/wiki/contents/articles/51121.active-directory-schema-update-and-custom-attribute.aspx
Amongst the particular roles of some Domain Controllers there is the Schema Master, which is what you need to identify, switch to a writeable mode (it's set as read-only to avoid mistakes). Great care should be taken due to the potential for messing it up. I never had the luxury of a test labl, but that would be idea.
The article is fairly long, so read it through a couple of times, the examples were helpful to me).