robots.txt is a plain-text file at the root of a site that tells crawlers which paths they may or may not fetch. It follows the Robots Exclusion Protocol, RFC 9309. It is a request, not an access control, and it controls crawling rather than indexing.
More about robots.txt
Each subdomain needs its own file.