Generally speaking, the mechanic's lien warning only needs to be provided by a contractor that has a direct contract with the homeowner. If you are a subcontractor working for a general, you do not even need a written contract (you should have one to protect your self, but one is not required).
If you have a direct contract with the owner, then you need to make sure your contract complies with all of the Home Improvement Contract requirements, which includes the mechanic's lien warning. If that is the situation, then the warning goes to the owner.
As a subcontractor, you will need to give a preliminary notice to the owner, the general contractor, the lender, and possibly others. The general should provide you with that information.
You should probably contact a construction attorney to make sure you are doing things correctly and to protect your rights.
I agree with Mr. Spirtos's answer. Be sure to prepare a proper preliminary notice and have it properly served, to protect your mechanic's lien rights. Good luck.
Mechanic's lien laws were designed to permit a contractor, subcontractor, supplier or laborer to claim a security interest in property they improved by performing construction. The problem is that the laws are incredibly technical, as you have obviously found because of the nature of your question.
I recommend that you hire a construction lawyer to help you get the process perfected so that you can do it yourself in the future, or better yet, have them do it for you, as I tell my own clients, you stick to plumbing and I will stick to lawyering. You could use a service to do the work for you, but they are notoriously bad. Even the "best" ones , the ones with the real slick websites, disclaim all liability for mistakes they make. One I even saw today now had on their website homepage a claim that there are "no excuses" despite this they have a horrible disclaimer in their fine print, putting all liability on you, even making you indemnify them for mistakes. Hire a lawyer who practices in your area. Either of the two who have previously answered would do fine for you. I have seen their answers on Avvo and they are both quality lawyers.
IF YOU FOUND THIS ANSWER HELPFUL PLEASE MARK IT SO. The answers provided by R. Russell O’Rourke, Attorney-at-Law as a free informational service only. Without thoroughly reviewing your case neither I nor any other attorney can give you a complete answer upon which you could or should rely. Your reading of this or any of my answers does not create an attorney client relationship between us. Legal cases are often very fact specific and need a qualified attorney to properly review ALL of your materials and fully discuss your case with you before you decide the right course of action to take. YOU SHOULD CONSULT WITH AN ATTORNEY IN PERSON who has specific expertise in the area of law you are asking about.