I wanna host many subdomains on one server with only one public ip. For example there would be: service1.myurl.com, service2.myurl.com and myurl.com. How can I achieve that ? Would running the different services in containers and referencing them work?

  • you can put proxy service or load balancer and forward those requests into local ips/ports where real services would run.
    – Martynas
    Dec 8, 2017 at 12:24
  • Would all your services run on the same server? Because then it is simple: NginX and create as many configs as many subdomains you would have.
    – Bert
    Dec 8, 2017 at 12:39
  • @Bert yes all on the same server... will check your solution...
    – Nabil B
    Dec 8, 2017 at 14:01
  • Do you actually want to run a DNS server, or are you just trying to set up a number of websites. If it is the latter, what you want is supported by most webservers, nginx (by creating multiple Server sections, apache (by creating multiple name based VirtualHost entries), Microsoft IIS (by creating multiple sites and binding them to a specific host names) etc.
    – HBruijn
    Dec 8, 2017 at 14:23

1 Answer 1


The most correct way for you to do this, install serial and configure BIND9 as authoritative to forward these requests to your web server.

Pointing your domain to the IP of the DNS server you just installed. Set up a DNS zone for that domain, and indicate the subdomains that your web server wants answered, as well as configure your virtualhost on the web server to respond to the subdomains created.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .