My friend runs a website called XYZ.com but hasnt copyrighted the name XYZ. I would want to use XYZ as the name of my startup too and would like to copyright it this time. Do i have to ask him permission before I copyright it even though he doesn't own the copyright? Btw, XYZ.com is a defunct student startup whose website is lying idle for months.
Maybe you are thinking about trademarking the name?
An abandoned name may be available for you to use or even register, but there are considerations, like whether the name is already being used by someone else, or whether the name is really abandoned.
You can either have an attorney validate the name so you know where you stand, or go ahead and file a trademark application and see what happens. The examiner or someone else already using the mark may prevent you from proceeding.
You mention your mark is similar to an existing web domain. Relevant factors may be whether you are intending to use the name for the same business as your friend, and how unique the name is. It may be worthwhile to consider some alternative names.
First of all, the term you are thinking about is trademarking. Copyright is for written or creative pieces of work, such as a book, song or website article. Trademarks are for protecting names and logos.
If your friend has not registered XYZ as a trademark, then you or anyone else is free to go ahead and do so. However, if you were to register this as a trademark, then you would need to take steps to protect your trademark, and that would mean sending a cease and desist letter to your friend, demanding that he removes the website. Failure to enforce a trademark can cause you to lose the rights to it, and would certainly count against you in the future if you ever tried to enforce the trademark against a third party.
Given that this is a friend of yours, you may wish to consider if it is morally acceptable for you to do so. I'm sure your friend will not be too happy to hear that you have taken his name and registered it as a trademark, and even less so when he starts receiving legal notices from you! I would strongly recommend speaking to your friend and asking for permission before continuing, or even better, find an alternative name.
Note: it is not entirely necessary to trademark a businesses name. You could still register XYZ as a company, and trade under that name without trademarking it. However doing so leaves you with the risk that your friend or a third party may register it, in which case you will be the one getting the cease and desist notices!
Personally I would recommend just finding a new name and saving yourself a lot of grief and legal fees.