I am quite new about Linux. I wonder if I could run DNS and Web Server on the same server?

The reason is I have a server which they want me to set it up as a DNS & RevDNS server with the following spec;

HP Proliant DL120 Gen9 
E5-2603v3 1.6GHz 6 15MB 
16 GB Ram PC4-2133P-R Kit
1 TB SATA 7.2k RPM
1 Gbps HPE Embedded Dual Port 361i Adapter

This server has 1 Gbps Download, 2 Gbps Upload fiber connection.

I don't want to waste this server just for DNS & RevDNS. Should I convince them to rent 2 VPS in different location to use them as DNS Server?

Thanks in advance for your suggestions and answers.

  • 3
    You shouldn't have just a single DNS server. 3-4 DNS servers would be more appropriate.
    – kasperd
    Feb 8, 2016 at 13:44
  • Hello, am I able to use mine with ARIN, and RIPEs DNS Server? Feb 8, 2016 at 13:48
  • 3
    Why do you want to host your own DNS in the first place? If you're new to this, let someone else do it initially while you learn the technologies.
    – EEAA
    Feb 8, 2016 at 14:02
  • @EEAA I just want to learn as quick as possible and do it by my own. I just wonder If I could run Web Service and DNS Service on the same server since the ports doesn't conflict. I also wonder if hosting master dns on my datacenter and rent a VPS to run as a slave. Thank you for your suggestion. Feb 8, 2016 at 14:18
  • 4
    My suggestion is to not run your own DNS.
    – EEAA
    Feb 8, 2016 at 14:19

3 Answers 3


It is possible but not recommended if you have more than just the web server relying on that planned DNS, i.e your company email, ftp, etc. also using that DNS.

From a security standpoint alone, your web server will provide a very big attack surface and you do not want your DNS compromised. Use an online DNS provider which are plenty and cheap instead.


It's possible (DNS does not require much hardware-wise). It was common practice, but is not recommended. The downside of having DNS, Web, etc. On the same box is that when it goes down, everything goes down.

There are plenty solid free DNS servers that have great infrastructure Rackspace and Namecheap to mention a few.

In my experience the biggest problem is that if your DNS goes down, so does your Email, Website, etc. So having those three separated is always a good idea. Nobody hosts their own email nowadays, that will be the same for DNS soon.

Another option following best practices is to host your own DNS but having an external provider as secondary DNS.

  • +1 for that last paragraph; it's what I, and many others I know, do.
    – MadHatter
    Feb 8, 2016 at 16:53
  • @EduardoRomero, Thank you for these valuable information. I was planning to set up my primary DNS in my local datacenter and set slaves on different providers. I wanted to setup my own DNS since I have 2 /22 blocks in RIPE. Feb 9, 2016 at 10:16

Running a web server and a name server on the same machine is possible and common. If you can do so on your machine depends on things in your setup that we can only guess. But if we guess that you have a real, unfiltered Internet connection with real IP addresses (rather than CG-NAT or something like that), then yes, you can.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.