A DMZ, or demilitarized zone, is a perimeter network segment placed between the internet and an organization's private internal network. It hosts public-facing services such as web, email and DNS servers, so outsiders can reach those services without getting direct access to internal systems, databases or employee devices.
Key takeaways
- A DMZ is a network segment, not a device: it sits between the internet and your internal network, guarded by firewalls on both sides.
- Only public-facing services belong in a DMZ — web, email, DNS and proxy servers — never databases or internal file servers.
- A DMZ only works with strict firewall rules: the internet can reach the DMZ, but the DMZ must not be able to start connections into your internal network.
Every company needs some servers the public can reach: a website, an email server, a DNS server. The problem is that any server the internet can reach is also a server attackers can reach. A DMZ solves that tension by giving public services their own guarded neighborhood.
What is a DMZ in networking?
A DMZ, or demilitarized zone, is a perimeter network segment placed between the internet and an organization's private internal network. It hosts public-facing services, so outsiders can use them without getting direct access to internal systems.
NIST defines a DMZ as a perimeter network segment that is logically between internal and external networks, whose purpose is to enforce the internal network's security policy for external information exchange while shielding internal networks from outside attacks, as set out in the NIST CSRC glossary.
The name comes from the military term for a buffer area between opposing forces where military activity is not allowed. In networking, the DMZ is the buffer between a trusted network and an untrusted one. It is also called a perimeter network or a screened subnet.
Three things make a DMZ what it is:
- It is a segment, not a device. You cannot buy a DMZ in a box. It is a subnet created by firewall rules.
- It has two guarded boundaries. One firewall boundary faces the internet, the other faces the internal network.
- It is less trusted than the inside, more trusted than the outside. Servers there are expected to be attacked, so they are isolated accordingly.
How does a DMZ work?
A DMZ works by forcing all traffic between the internet and your internal network to pass through firewall rules at two boundaries. Internet users can reach DMZ servers, but they cannot pass straight through to internal systems.
The outer firewall allows only the traffic each public service needs. A web server gets ports 80 and 443, a mail server gets port 25 and its submission ports, and everything else is dropped. The inner firewall is stricter still: it allows only the specific connections DMZ servers need to do their job, such as a web server querying a database on one port.
The critical rule is direction. The DMZ can answer requests from the internet, and internal users can reach the DMZ, but DMZ servers must not be able to start new connections into the internal network. If a web server is compromised, that rule is what stops the attacker walking straight into your file servers.
What belongs in a DMZ — and what does not?
Anything that must be reachable from the internet belongs in a DMZ. Anything that holds sensitive internal data, or that only employees need, does not.
| System | Belongs in a DMZ? | Why |
|---|---|---|
| Web server | Yes | Must be reachable by the public |
| Public DNS server | Yes | Answers queries from anyone on the internet |
| Mail server | Yes | Receives email from other mail servers worldwide |
| Reverse proxy / load balancer | Yes | Front door for web traffic, shields back-end servers |
| VPN gateway | Yes | Remote users connect to it from outside |
| Database server | No | Only the web server needs it, on one port, from the LAN |
| Internal file server | No | Employees only; no public reason to expose it |
| Domain controller | No | Controls logins for the whole network; keep it inside |
A common mistake is putting the database next to the web server for convenience. That defeats the purpose of the DMZ. Keep the database on the internal network and allow only the web server's specific database connection through the inner firewall.
Check Point makes the same point in its DMZ guidance: DMZ systems may need access to internal data, but connections between DMZ systems and internal systems should undergo additional inspection for malicious content, as described in Check Point's DMZ network guide.
What are the main DMZ architectures?
The two classic designs are a single firewall with three interfaces, often called the three-legged model, and a dual-firewall design with the DMZ between two separate firewalls. Modern networks add a third pattern: multiple DMZs for different trust levels.
Single firewall, three legs
One firewall has at least three interfaces: one for the internet, one for the DMZ, and one for the internal network. Rules on each interface control what can cross. This is cheaper and simpler to manage, but it is a single point of failure: a flaw in that one firewall can expose both boundaries.
Dual firewall, back to back
Two firewalls sit in series, with the DMZ between them. The outer firewall guards the internet boundary and the inner firewall guards the internal boundary. This is the more secure approach, and it is stronger still when the two firewalls come from different vendors, so one vulnerability is unlikely to affect both.
Multiple DMZs and screened subnets
Larger organizations run several DMZs: one for public web services, one for partner connections, one for remote access. Each has its own rules. A partner DMZ, for example, may allow a supplier's systems to reach one specific application and nothing else.
DMZ vs firewall vs VPN: what is the difference?
These three are often confused because they work together. A firewall filters traffic, a DMZ is a network segment built with firewalls, and a VPN is an encrypted tunnel that lets remote users reach the internal network safely.
| DMZ | Firewall | VPN | |
|---|---|---|---|
| What it is | A network segment | A filtering device or software | An encrypted tunnel |
| Job | Isolate public services | Allow or block traffic by rule | Give remote users secure access |
| Who it serves | Internet users | Every network boundary | Remote employees and sites |
| Alone, is it enough? | No | No, it needs rules and monitoring | No, it needs authentication and patching |
A DMZ without a firewall is just an exposed subnet. A firewall without a DMZ can still leave a public web server sitting on the same network as your databases. The two are complementary, not alternatives. Our guide to how to secure your Wi-Fi covers the home-network version of the same segmentation idea.
What is a DMZ host, and why is it risky?
A DMZ host is a setting on many home routers that forwards all unsolicited internet traffic to one device on your home network. It is not a real DMZ, and it is much riskier than it sounds.
In a true DMZ, a server is isolated from the internal network by firewall rules. With a DMZ host, the chosen device sits on your normal home network, with the router's firewall effectively switched off for it. Every open port on that device is reachable from the internet, and if it is compromised, the attacker is already inside your home network.
People usually enable it to fix a game console or video call that will not connect. A safer fix is port forwarding for only the specific ports the application needs, or UPnP if you trust the device. If you do use a DMZ host, use it only temporarily, keep that device fully patched, and never use it for a computer that holds personal files.
What are the benefits of a DMZ?
The main benefit is containment. Public-facing systems are the most likely to be attacked, so putting them in a separate segment limits the damage when one is compromised.
Check Point lists several concrete benefits: protection of internet-facing systems, protection of internal systems, limited lateral movement for attackers, less network scanning of internal hosts, and tighter access control between zones, as set out in its DMZ network guide.
There are operational benefits too. A DMZ makes firewall rules easier to audit, because the rules for public services live in one place. It also improves performance: heavy public traffic hits the DMZ and its firewalls, not your internal infrastructure.
None of this makes a DMZ a complete security solution. It is one layer. Patching, monitoring, strong authentication and backups still matter, because a DMZ server that is never patched will eventually be compromised.
How do you design a secure DMZ?
Design a DMZ by starting from the services you must expose, then writing the narrowest rules that let those services work. Every rule you add should answer a specific need.
- Deny by default. Start with no traffic allowed, then add only the ports and protocols each service needs.
- Block DMZ-to-LAN initiation. DMZ servers answer requests; they do not start connections into the internal network.
- Use a reverse proxy. Put a proxy or load balancer in the DMZ and keep the real application servers behind it.
- Patch DMZ hosts first. They are scanned constantly, so their patch window should be the shortest in the company.
- Add inspection. A web application firewall in front of web servers and intrusion detection at both boundaries catch attacks the firewall rules miss.
- Log and alert. Log every connection crossing a DMZ boundary and alert on anything unusual, such as a DMZ server trying to reach an internal host.
- Test it. Run a port scan from outside and from a DMZ host to prove the rules do what you think they do.
How does a DMZ work in the cloud?
In the cloud there is no physical firewall box, but the DMZ pattern is the same. You create a public subnet for the load balancer and a private subnet for application and database servers, then use security groups and network access lists as the firewall rules.
A typical cloud layout puts the load balancer in the public subnet, the application servers in a private subnet that only the load balancer can reach, and the database in a further private subnet that only the application servers can reach. That is three trust zones, which is the same idea as a DMZ, just implemented with cloud controls.
Cloud providers also add managed options: a web application firewall in front of the load balancer, and a bastion host or session manager for administrative access, so no server needs a public management port.
If you run a website, check its public posture with our free SSL checker.
Common DMZ mistakes to avoid
Most DMZ failures are rule mistakes, not architecture mistakes. The design is sound; the implementation drifts.
- Allowing any-to-any rules for convenience during setup and forgetting to remove them.
- Putting a database in the DMZ because the application was easier to configure that way.
- Letting DMZ servers reach the internet freely, so a compromised server can download malware or exfiltrate data.
- Skipping monitoring, so a compromise in the DMZ goes unnoticed for weeks.
- Using one firewall for both boundaries in a high-risk environment, with no plan for its failure.
- Confusing a DMZ host with a DMZ on a home or small-office router.
Review DMZ rules at least every quarter, and after every new service launch. Rules accumulate, and each one is a hole an attacker can use.
The bottom line
A DMZ is a simple idea with a large payoff: give public services a guarded space of their own, and keep everything else behind a second wall. It does not make you invulnerable, but it turns a compromised web server from a company-wide incident into a contained one.
Start with the inventory: list every service the internet must reach, put only those in the DMZ, and write deny-by-default rules on both boundaries. Then verify your public services with the free DNS lookup and the rest of Cysoro's free tools.
Frequently asked questions
What is a DMZ in networking in simple terms?
A DMZ is a buffer zone in your network. Public-facing servers live there, between the internet and your private network. Outsiders can reach those servers, but firewall rules stop them from reaching your internal computers and data.
What is the difference between a DMZ and a firewall?
A firewall is a device or software that filters traffic according to rules. A DMZ is a network segment created and protected by firewalls. You use firewalls to build a DMZ, but a firewall on its own is not a DMZ.
Do I need a DMZ at home?
Most homes do not need a real DMZ. A home router's DMZ host feature is different and much riskier: it exposes one device fully to the internet. For a home lab, a separate VLAN with strict rules is usually safer.
What servers go in a DMZ?
Web servers, public DNS servers, mail servers, FTP servers, reverse proxies and VPN gateways are the usual residents. Anything that must be reachable from the internet belongs there, and nothing else does.
What is a DMZ host on a home router?
A DMZ host is a router setting that forwards all unsolicited internet traffic to one device on your home network, bypassing the firewall for that device. It is not a true DMZ and it leaves that device fully exposed.
Is a DMZ still used in cloud networks?
Yes, the idea survives in the cloud as segmented subnets, security groups and network security groups. A public subnet holding a load balancer, with a private subnet behind it for application and database servers, is the cloud version of a DMZ.
Can a DMZ be hacked?
Yes. Servers in a DMZ are exposed to the internet and are attacked constantly. The point of a DMZ is containment: if one is compromised, firewall rules should stop the attacker moving into your internal network.
How many firewalls does a DMZ need?
You can build one with a single firewall that has three interfaces, or with two separate firewalls back to back. Two firewalls are more secure, especially if they come from different vendors, because one flaw does not open both boundaries.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the NIST CSRC definition of a demilitarized zone and Check Point's DMZ architecture guidance.
How we write and fact-check →