Skip to main content
50% off all plans, limited time. Starting at $2.48/mo
12 min left
Security & Networking

What Is a DMZ in Networking?

J By Jonas 12 min read
Diagram comparing a three-interface DMZ firewall with the same isolation pattern arranged inside a single server

DMZ arrives without a definition attached to it. A line item on a security review checklist, a sentence in a vendor's hardening document, a requirement in a job posting sitting beside TLS and least privilege.

You look it up and find a diagram of a firewall with three network cables in it. One goes to the internet, one goes to a row of servers, one goes to an office LAN. What you administer is one rented server with one public IP and no spare network interfaces at all.

The first picture is a true DMZ architecture. On one server, you can reproduce part of its security goal: limiting what the internet can reach. What you cannot reproduce on that same host is the separate network boundary that makes a DMZ a DMZ.

The Short Version

  • A DMZ separates the services strangers must reach from the rest of what you run.
  • The point was never the cabling: it was that a compromise on the public side should stop there.
  • You can configure a firewall and still not have a DMZ.
  • One server with one public IP can reduce exposure with a reverse proxy, host firewall rules, and private or loopback bindings, but it does not create a separate DMZ segment.
  • That version shares a kernel with what it protects, so count it as reduced exposure and not as isolation.

What This Article Doesn't Cover

The scope here is the mental model, and three adjacent topics are deliberately left alone.

  • No build steps. There is no reverse-proxy configuration, no firewall rule syntax, and no recommendation about which tool to install.
  • No consumer-router configuration. The "DMZ host" toggle on a home router names something else entirely.
  • No verdict on zero-trust. Whether the network perimeter is still the right primary control is a real argument, and it is not settled here.

What Is a DMZ, and What Is It For?

A DMZ, or demilitarized zone, is a network segment that sits between the untrusted internet and an internal network. It holds the services that must be publicly reachable, such as web servers and mail servers. Everything else stays behind a second boundary, so reaching the public service does not mean reaching the rest.

Mozilla's glossary entry for a DMZ puts the operative half of that in one clause: it exposes only certain defined endpoints, while denying access to the internal network from outside. That is the whole design goal, stated without reference to any equipment.

The service types that classically live there follow from the goal. Web servers, mail servers, FTP servers, VoIP servers: things that strangers are supposed to be able to connect to. Directory servers, databases, file shares, internal applications, and administrative interfaces are not on that list, because nobody outside is supposed to reach them at all.

Hold onto the property rather than the picture. Three network interfaces are one way to create a separate trust boundary. Cloud and single-server designs can apply the same exposure-control principle in different ways, but only designs with a distinct perimeter zone reproduce the DMZ itself.

How Does the Classic Three-Interface DMZ Work?

Side-by-side diagram of the two classic DMZ builds. On the left, a single-firewall three-legged design where one firewall carries a WAN link to the internet, a DMZ link to a web server and a mail server, and a LAN link to an internal network of database, admin workstation and internal application, with internet-to-internal traffic blocked. On the right, a dual-firewall back-to-back design where the DMZ sits between an external firewall and an internal firewall, giving two separate policy boundaries at the cost of more configuration.

The classic DMZ is built two ways. A single-firewall design gives one firewall three interfaces, one each to the internet, the DMZ, and the internal network. A dual-firewall design places the DMZ between two separate firewalls. Both enforce the same rule. The internet reaches the DMZ. The internet never reaches the internal network.

The Single-Firewall (Three-Legged) Model

One firewall, three network interfaces. The first faces the internet. The second faces the DMZ, where the public services live. The third faces the internal network. The firewall permits inbound traffic from the internet to specific ports on the DMZ, permits narrow DMZ-to-internal traffic where an application requires it, and denies everything else.

The name for this shape is the three-legged firewall. Every packet crossing between zones goes through one device, which makes that firewall a single point of failure for inter-zone traffic. If it fails, connectivity and policy enforcement are affected according to the firewall's failure mode and any redundancy you have in place.

I spent a decade running network operations at an ISP, and what surprised people about a DMZ interface was how unremarkable it was. An ordinary ethernet port with a different trust label attached to it in the firewall's configuration. The architecture was not in the copper. It was in the rule set, and in someone having thought carefully about which direction each flow was allowed to go.

The Dual-Firewall (Back-to-Back) Model

Two firewalls in series, with the DMZ between them. The external firewall permits internet traffic into the DMZ and nothing further. The internal firewall permits only the specific DMZ-to-internal traffic an application needs. An attacker who reaches the DMZ still has to cross the internal firewall's policy boundary before reaching the internal network.

Two firewalls give you two separately enforced policy boundaries, but they also add configuration, patching, and operational complexity. A failure or compromise of the external boundary does not automatically remove the internal one, though the protection still depends on how the two firewalls are configured and managed.

Is a DMZ the Same as a Firewall?

No. A DMZ is a separate perimeter network or network segment. A firewall is one common control used to enforce traffic between that zone, the internet, and the internal network. You can configure firewall rules on a flat network without creating a DMZ, so the distinction is architectural, not just a matter of firewall configuration.

The conflation is understandable. The firewall is the object you log into, the thing with a configuration file and a vendor and a support contract, so it collects the name of the thing it produces. Nobody ever logs into a segment.

The consequence shows up at the worst possible moment. Assume your public web server is compromised, because eventually one will be. On a flat network the attacker now has a foothold on a machine that can already talk to your database, your file server, and your administrative interfaces, and moving between them is just using access that was already permitted. That sideways travel is called lateral movement, and it is what the second boundary exists to stop. The DMZ does not prevent the web server from being compromised. It is what keeps a compromised web server from becoming access to everything else.

One clarification while the term is in front of you: the "DMZ host" setting on a home or small-office router is a different feature. It forwards unsolicited inbound traffic to one internal device, exposing that device directly to the internet; it does not create a separate, protected DMZ network.

How Do You Apply DMZ Principles on One Server?

A single server with one public IP can reproduce part of the DMZ's exposure-control goal without reproducing its network separation. A reverse proxy can become the only public entry point, default-deny inbound firewall rules can block the rest, and internal services can bind to loopback or a private interface instead of the public address.

Start with the constraint this section assumes: one VPS, one public interface, and no separate firewall appliance or DMZ subnet you control. In that setup, you cannot reproduce the classic three-legged topology on the same host. Host firewall rules, service binding, and a reverse proxy can still reduce exposure, but they do not create the same isolation boundary.

A reverse proxy can occupy the public interface on ports 80 and 443 and become the only application-layer entry point for web traffic. That narrows the public attack surface, but it is not equivalent to a separate DMZ interface because the proxy still shares the host with the services behind it.

Inbound firewall rules on the host permit those two ports and drop the rest. Every other service on the machine may be running and listening, but nothing outside can initiate a connection to it. This approximates the "only intended ports are reachable" policy on one host; it does not create a separate internal-network boundary.

Application servers, databases, and admin panels should not bind to the public address. When the proxy runs on the same host, they can listen on loopback; when it runs elsewhere on the private network, they can listen on a private address. In either case, there is no listener for those services on the public interface, so opening an inbound rule on that interface alone does not expose them.

Administrative access belongs on the internal side, not the DMZ side. Keeping SSH and management interfaces off the public path, behind a VPN or a private network, prevents direct connections to them from the public internet.

How Do DMZ Concepts Map onto VPC Subnets and Security Groups?

Diagram mapping classic DMZ elements onto cloud primitives inside a VPC. The DMZ segment maps to a public subnet holding a load balancer or proxy, reachable only when an internet route, a public address and permitted rules all line up. The internal network maps to a private subnet holding an application server and a database with no internet-gateway route. Zone firewall rules map to stateless network ACLs at the subnet edge, and per-resource rules map to stateful security groups attached to each resource.

The classic model has a close conceptual mapping to cloud networking primitives, but it is not one-to-one. A DMZ segment becomes a public subnet. The internal network becomes a private subnet with no route to an internet gateway. The firewall's rule set splits across security groups, which are associated with resource network interfaces, and network ACLs, which are attached to subnets.

Classic ElementCloud EquivalentWhat It Enforces
DMZ segmentPublic subnetProvides an internet route; a resource also needs a public address and security rules that permit the traffic
Internal network segmentPrivate subnetNo direct internet-gateway route, so the internet cannot initiate direct connections through that path
Firewall interface between zonesRoute table + internet gateway attachmentWhere traffic can be routed; public addressing and security controls still determine whether a resource is reachable
Firewall rule set (per zone)Network ACLsStateless allow and deny rules evaluated at the subnet edge
Firewall rule set (per host)Security groupsStateful allow rules applied to the network interfaces of associated resources
Public-facing service in the DMZLoad balancer or proxy instance in the public subnetThe single entry point traffic must pass through

Cloud vendors use the vocabulary themselves, which is good evidence the term is still current. AWS's networking blog describes a DMZ architecture on Amazon VPC that isolates public-facing services from internal networks, built on VPC Block Public Access, a Region-level control it launched in November 2024.

Subnets are the load-bearing part of the mapping. A public subnet is public because its route table points at an internet gateway. Since route tables decide where packets travel, subnet layout shapes your exposure before any individual rule does.

The mapping is imperfect in one specific way. A firewall interface enforced a boundary for a whole segment; a security group is associated with a resource's network interface. Two machines in the same private subnet can carry completely different security groups, so enforcement lands at a finer granularity than a physical interface ever managed. That is usually an improvement. It also means a subnet's name tells you less about what is reachable than a network diagram used to.

Where the Single-Server Version Falls Short

On one host, the public-facing process and the internal services share a kernel and a machine. Separate segments force an attacker across a network boundary that a firewall inspects; one host does not. The single-server pattern reduces exposure. It does not reproduce separation.

If the reverse proxy is compromised in a way that gives the attacker code execution, that code is already running on the machine your database runs on. Loopback binding does not help then, because loopback is reachable from the host. Container or user isolation can raise the effort required, but containers on the same host still share the host kernel. In the classic model the attacker's next step was a packet across a wire that something was inspecting. Here it is a local socket.

The practical consequence is a threshold, not a verdict. When what sits behind the proxy is worth more than the effort of a second machine, use a second machine and a private network between them. Nothing in this article has to be relearned to do that, because none of it was ever about the hardware.

View Linux Plans

Build on a Linux VPS with root access, NVMe, and AMD EPYC power.

View Linux Plans

The perimeter is no longer the only place security policy can be enforced. Zero-trust architecture removes implicit trust based on network location, while private connectivity built with WireGuard or Tailscale can reduce public exposure. Neither approach automatically replaces segmentation or authorization. My position on the narrower question is flat. As a mental model, sort what is reachable from what is not, and know which boundary contains a compromise. That question survives every architecture named above, which is why it is still worth answering.

Frequently Asked Questions

Is a DMZ the Same as a VPN?

No. They solve different problems. A DMZ controls what untrusted outsiders can reach, by exposing a small set of services and nothing else. A VPN gives trusted outsiders a private path in, by authenticating them onto a network they would not otherwise reach. Many networks run both, and neither substitutes for the other.

Is a DMZ Safe?

A DMZ does not make an exposed service safe. It limits what a compromise of that service reaches. The public-facing service is still public-facing, still exposed to everyone on the internet, and still needs patching, monitoring, and hardening on its own terms. The DMZ decides what happens after it falls, not whether it falls.

Do I Need a DMZ If I Only Have One Server?

Not the classic kind, and you could not build one on a single host anyway. The three-interface topology needs separate network segments, and one server with one public IP has none. What you can do is control exposure: make a reverse proxy the only public entry point, default-deny the rest of the inbound ports, and bind internal services to loopback or a private address. That reduces what the internet can reach without isolating the public service from the rest of the host. When what sits behind the proxy is worth more than the cost of a second machine, use two machines and a private network between them.

Why Is It Called a Demilitarized Zone?

The term is borrowed from the military sense of a buffer area between two opposing forces where neither is fully in control. The network usage keeps the metaphor: the DMZ belongs entirely to neither the untrusted outside nor the trusted inside.

Share

Discussion

Comments

Sign in to join the discussion.

More from the blog

Keep reading.

Ready to deploy? From $2.48/mo.

Independent cloud, since 2008. AMD EPYC, NVMe, 40 Gbps. 14-day money-back.