0

What is the correct DNS configuration for multiple subdomain names, so that they will work with nginx server blocks and/or Apache virtual hosts?

Example:

Server IP Address: 192.0.2.0 Main/primary subdomain name: vegetable.example.com

Other subdomain names to be served by this rig:

  • artichoke.example.com
  • bean.example.com
  • carrot.example.com

How to properly configure the DNS records to work with Apache virtual hosts or nginx server blocks?

  • A record?
  • CNAME?
  • Alias?
2
  • 1
    Within example.com you declare a NS record for each of the subdomains and within them, you create A records just as you normally would for example.com. It's really not difficult, just remember to get the SOA correct. For reverse, you just list all the hosts against the single IP address. Commented Apr 13, 2023 at 21:14
  • 1
    Many DNS services allow you to define an A record with the wildcard name *.example.com so any undefined subdomain uses the default IP address. Nginx and Apache don't care if your domain names are defined as A or CNAME records - it's the browser's job to use DNS to resolve the domain into an IP address. Commented Apr 14, 2023 at 9:27

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.