Correct arrangements.
THE PRINCIPLE
The client's domain should be registered in the client's name, with their details as registrant.
You may manage it. You should not own it.
HOW TO DO IT
Register the domain using the client's details as the registrant.
Hold the account access as their agent, with that stated in writing.
WHY
The registrant record establishes ownership. A domain in your name that the client believes is theirs creates a dispute.
It also makes you responsible for something you should not be.
FOR HOSTING
Either hold the account and agree in writing what happens at the end of the engagement, or let the client hold it with you having access.
WHAT TO AGREE
Who owns the domain Who holds the hosting account Who renews what What happens when the relationship ends
IF A DOMAIN IS ALREADY IN YOUR NAME
Change the registrant details to the client's.
Note that some extensions treat this as significant and apply a transfer lock afterwards.
RESOLVE IT NOW
While the relationship is good, not during a dispute.