The term comes from the military: a demilitarised zone is a neutral strip between opposing sides. In networks it is a buffer between the internet and the internal network, holding whatever must be reachable from outside: websites, mail servers, reverse proxies.
Why a separate segment
Public services accept connections from anyone, so they are attacked most often. If such a service sits directly on the internal network, compromising it gives an attacker a path to workstations, databases and file servers. A compromise of a service in the DMZ stays local: the firewall blocks any onward traffic.
- From the internet to the DMZ: only the ports that are needed, such as 443 for a website and 25 for mail.
- From the DMZ to the internal network: everything is denied by default, and only specific requests are allowed, for example a web server reaching a database server.
- From the internal network to the DMZ: only what is needed for updates and administration.
- From the internet to the internal network: nothing except replies to outgoing requests.
Typical layouts
There is no single technical definition of a DMZ, as NIST points out in its firewall guidelines. In practice the name is used both for a separate firewall interface and for a network between two firewalls; in the cloud, subnets play the same role.
| Layout | How it works |
|---|---|
| One firewall, three interfaces | the firewall connects the internet, the DMZ and the internal network, and filters traffic between all three |
| Two firewalls | the outer firewall lets only public traffic into the DMZ, and the inner one sits between the DMZ and the internal network |
| Cloud | a public subnet with public addresses and private subnets inside a virtual network; security groups and route tables play the role of firewalls |
One firewall with three interfaces is the typical choice for a small network: it is cheaper and simpler to configure. Two firewalls provide defence in depth: compromising the outer one does not open a path to the internal network, and the rules on the outer and inner firewalls are configured independently.
Example rules
# internet -> DMZ: web port onlyallow tcp dport 443 -> 203.0.113.10# DMZ -> internal network: deny by defaultdeny ip 203.0.113.0/24 -> 10.0.0.0/8# exception: the web server talks to its own DBMSallow tcp 203.0.113.10 -> 10.0.1.20 port 5432The zero-trust approach weakens the role of the network perimeter: every request is verified on its own, not by its place in the network. Even in that model, public services are given an isolated part of the network: a DMZ in a classic estate or a public subnet in the cloud.
Sources
the term is written from these pages- NIST SP 800-41 Rev. 1 — Guidelines on Firewalls and Firewall Policynvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-41r1.pdf(opens in a new tab)
- NIST CSRC Glossary — demilitarized zone (DMZ)csrc.nist.gov/glossary/term/demilitarized_zone(opens in a new tab)
- AWS Documentation — VPC with public and private subnets (NAT)docs.aws.amazon.com/vpc/latest/userguide/vpc-example-private-subnets-nat.html(opens in a new tab)
Verified 9 Nov