You may be unclear on what a subdomain is.
Take this example URL:
http://www.example.com
In this URL, "example.com" is your root domain, and the subdomain is "www". Its the piece of the url separated from the root domain by a .
.
HTTP and HTTPS are not subdomains, they are protocols, separated from the subdomain/domain usually by ://
. In the above example the protocol is http
.
Broadly speaking, A domain (with or without a subdomain) tells the browser where to look for a website, but protocols like HTTP and HTTPS determine how it communicates with the website. Protocol is not decided by DNS, but by the browser and your website.
DNS A records associate domain names (like "example.com") to IP addresses (like 8.8.8.8).
If you also want your website to have a subdomain, like foobar
(foobar.example.com
), you require a CNAME entry, which defines foobar.example.com
as an alias, in other words, it says "foobar.example.com" should go to the same website as "example.com".
More on that in this article.
Once you can do this much, you should be able to access example.com and foobar.example.com over http, and https, as long as your hosting supports both. This is because the protocol portion of the URL tells your browser how to speak to the website, not where to look for it (so it's looking in the same place for http and https).
P.S. I'm not 100% sure if this answers your question, as I'm not 100% sure I understand your question. If you are instead wondering how to redirect from http to https, you can do that separately via HTTP redirects, so long as your hosting supports it. The hoster might possibly also just offer a "force HTTPS" option, but I'm not sure.