dns record

My question is I have registered a domain through godaddy. I have been creating a new A record for each sub domain and main domain I create in virtualmin. For example I’ll use example.com. for a new domain called example.com I have to make two A records one www.example.com to get http://www.example.com to show in browser and another record with just example.com to get http://example.com to show in browser. I also have to do this for every subdomain that I create. Is this the proper way to do this or am I missing something? If I don’t make any A records at godaddys then none of the webpages will show up. Thanks for your time.

yes this is one way of doing things.

The other way is to use nameserver if you are running them.

By giving the domain at godaddy your ns records instead of A records, then all records will be automatically created by virtualmin on your box(saving you a lot of time)

However you need to be running 2 nameservers for this to work.