Situation
John Smith Ltd runs its mail server in-house, at 192.168.10.25. It is published on the WAN zone for receiving (SMTP, port 25), for the clients’ sending (587) and for reading mail (secure IMAP, 993), and the public DNS says:
mail.johnsmith.test. A 203.0.113.10
The employees’ laptops have the server mail.johnsmith.test in their mail client. Outside the office it works. In the office it does not: the client hangs or gets a refusal.
The reason: from the LAN the name leads to 203.0.113.10, the appliance’s address on the fibre. The publication, though, answers only on the interfaces of its zone, the WAN; a request arriving from the LAN is not translated and stays with the appliance, which has nothing on that port. There are two ways to solve it:
- Local DNS (split DNS), the recommended way: the appliance’s resolver answers the internal clients with the internal address, 192.168.10.25. The clients talk to the server directly, without going through the firewall.
- Hairpin NAT: the clients keep using 203.0.113.10, and the appliance translates that traffic towards the server too, bringing the reply back through itself.
What you need
- The mail server’s publication in Published services → Port publication. If it is not there yet, create it as in the Publishing an internal server scenario: “Ingress zone” WAN, “Protocol” TCP, “External port”
25,587,993, “Internal host”192.168.10.25, “Internal port” 0 (with a list of ports each one stays the same), “Allowed remote sources” empty (mail arrives from the whole internet), “Comment”Mail. Then apply and confirm. - For the DNS way: DNS protection on and the clients using the appliance as their DNS, as in the First office scenario (DHCP hands it out by itself).
- For the hairpin way: the public address the service is reached at from the internet, here 203.0.113.10.
Which one to use when
| Situation | Way |
|---|---|
| The external port is the same as the internal one (25, 587 and 993 as here) and the clients use the appliance’s DNS | Local DNS |
| The external port differs from the internal one (for example 8443 outside, 443 inside) | Hairpin NAT: with local DNS the client would look for 8443 on the server, which listens on 443 |
| An application is configured with the public address typed by hand, not with the name | Hairpin NAT |
| There are devices that use a DNS server of their own and you cannot force them | Hairpin NAT (or force the zone’s DNS, see below) |
| The service is behind a reverse proxy | Neither: switch on the LAN zone in the proxy (scenario Two internal websites with a reverse proxy, step 8). A local DNS record instead takes the LAN straight to the server, without the proxy: that is fine only if the server itself answers the way the clients call it, as the example company’s www.johnsmith.test site does in http |
| The publication has “Allowed remote sources” (like the NVR’s, for the security company) | Hairpin respects the sources: the internal clients not on the list are not translated. From inside use the internal address or its local DNS name (nvr.johnsmith.test → 192.168.10.30) |
Local DNS is to be preferred when it works: the traffic takes no detours, the server sees each client’s real address and no firewall rule changes. Hairpin is the solution when DNS is not enough.
Steps
Way 1: local DNS
-
Go to DNS and DHCP → DNS protection and check that “Enable DNS protection” is on. Local DNS is served by the appliance’s resolver: with protection off the records are saved but nothing answers them, and the block says so.
-
Go to DNS and DHCP → Local DNS and press “Add record” (the + button in the block’s bar). In the dialog:
Field Value “Address” 192.168.10.25 “Names” mail.johnsmith.test “Comment” Mail (split DNS) Type the full name: a single label (
mail) would answer onlymail.. If the server has other public names (for exampleautodiscover.johnsmith.test), add them in the same field, separated by spaces. Press “Add”: “Local DNS saved” appears. The record takes effect at once: there is nothing to apply. The block’s list also holds the company’s other internal names:argos.johnsmith.test(the console),nas.johnsmith.testandnas,nvr.johnsmith.testandwww.johnsmith.test.

Local DNS: the mail name resolved to the internal address -
The clients keep the old answer in their cache for a few minutes. On a PC that must work straight away, clear it:
ipconfig /flushdns -
Recommended: in DNS and DHCP → DNS protection, in “Force the appliance’s DNS”, check that LAN is on (it is if you followed the First office scenario). That way even a laptop with a DNS server set by hand gets the internal answer. If you have just switched it on, press “Save settings”, then “Apply” in the header and “Confirm” within 60 seconds.
For the technician The record becomes an Unbound
local-datawith its PTR, and it is also written into Argos’s block in/etc/hosts: the appliance itself resolves it whatever DNS server it uses. Unbound answers with the local record to anyone who asks, so the guests’ zone too: for the guests the name leads to a LAN address, which the firewall does not let them reach. A browser’s DNS-over-HTTPS gets round the resolver: the “Filter bypass” category blocks it.
Way 2: hairpin NAT
-
Go to Published services → Hairpin NAT. Switch on “Hairpin NAT”. In “Public addresses” the console offers the addresses it sees on the WAN side (the hint “Seen on the WAN side now: …” lists them): 203.0.113.10 must be among them. To add an address, type it in the field below the list and press + (“Add address”); to remove one, select it and press − (“Remove address”).
Keep on the list the addresses the clients call the service by, here 203.0.113.10. With a second line (see Two internet lines with automatic failover) the console offers its addresses too: for the FWA, the lease’s 192.168.8.100, which is private, and the public address the FWA goes out to the internet with. If the service’s public DNS does not name them, remove them.
If Argos sat behind a provider’s router, the address the service is reached at from the internet would be the router’s, not that of Argos’s WAN: in that case that is the one to put on the list.
Press “Save”: “Hairpin NAT saved” appears.


Hairpin NAT: on, with the fibre's public address -
Hairpin is a firewall rule: the status button in the header reads “Unapplied changes”. Press it, choose “Apply” and press “Confirm” within 60 seconds.
Warning With hairpin the server sees all the internal clients with the appliance’s address on its network, 192.168.10.1, not with their own. And hairpin applies to every internal zone other than the publication’s: GUESTS and PRODUCTION too reach the service by the public address, as if they came from the internet, but the server sees them as 192.168.10.1. A mail server that lets the LAN’s clients send without a password (a “relay” for the local network) would become an open relay for the guests. Before switching hairpin on, check that the service grants nothing on the strength of the LAN address; if it does, use local DNS.
For the technician For each publication with a zone, Argos adds to the nat table a second DNAT for the interfaces of the other non-WAN zones, towards the addresses on the list, with the same ports and the same allowed sources; the connections translated this way are marked, and masquerade rewrites them with the appliance’s address, so the server’s reply comes back to the appliance and not straight to the client. A publication with no zone (“Any zone”) is never reflected, and neither is one on the SSH port or on 8000; one on 443 or on 80 is. With hairpin off, or without valid addresses, the nat table is identical to before.
Verification
Local DNS
From the appliance. In Events and diagnostics → Diagnostics choose “DNS lookup”, type mail.johnsmith.test in “Name”, leave “Server” on “Local (the appliance’s DNS resolver, port 53)” and press “Run”. The answer is 192.168.10.25, with “Not blocked by DNS protection’s lists”.


From an office PC (PowerShell):
nslookup mail.johnsmith.test
Test-NetConnection mail.johnsmith.test -Port 993
The first command answers 192.168.10.25 with server 192.168.10.1; the second TcpTestSucceeded : True. The mail client connects with the same settings it uses outside.
Hairpin NAT
From an office PC, using the public address (or the name, if you did not create the local record):
Test-NetConnection 203.0.113.10 -Port 993
answers TcpTestSucceeded : True.
The translated connections. In Events and diagnostics → Diagnostics, “Connection tracking”, type 192.168.10.25 in “Address” and press “Show”: the PC’s connection to 203.0.113.10 appears translated towards the mail server.


In the log. In Events and diagnostics → Firewall, “Show” “Passed” and filter 192.168.10.25: the connection appears with rule zone-lan-fwd, the PC as source and the server as destination (already translated). On the mail server, on the other hand, the client shows up as 192.168.10.1.
If something goes wrong
nslookup still answers 203.0.113.10.
- The PC does not use the appliance as its DNS:
ipconfig /allshows another DNS server (set by hand, or a company VPN’s). Force DNS on the LAN (step 4) or correct the PC. - The old answer is still in the cache:
ipconfig /flushdns. - The browser or the program uses DNS-over-HTTPS: switch on the “Filter bypass” category in DNS and DHCP → DNS protection.
Saving the record shows “Saved — DNS protection is off, so nothing answers them yet”. Switch on “Enable DNS protection” (step 1).
The record is refused.
- “Not a valid IPv4 or IPv6 address” or “Not a valid host name”: check the two fields; the names are separated by spaces.
- “localhost and the IPv6 standard names belong to the system: they are never moved”: those names cannot be used.
- “Saved, but the resolver did not take them”: the record is saved but Unbound refused the configuration; the reason is in Events and diagnostics → System.
The name resolves to the internal address but the service does not answer. With local DNS the client goes straight to the server on the port it is configured with: if outside it uses a port other than the internal one (for example the 8443 of a publication towards 443), inside it does not find it. Use hairpin, or configure the client with the internal port.
With hairpin on, the connection from inside still does not work.
- You did not apply the firewall after saving: System status → Status says “Saved changes are not applied yet”.
- The address the client uses is not in “Public addresses”: check what the name resolves to and add that address.
- The publication has “Ingress zone” “Any zone”: it is never reflected. Put it on the WAN zone.
- The publication has “Allowed remote sources” and the internal client is not among them: hairpin respects them.
- The publication is on the SSH port or on 8000: it is never reflected.
Saving hairpin is refused.
- “Add at least one public address”: with hairpin on, the list cannot be empty.
- “Only IPv4 addresses”: no networks and no IPv6 addresses.
- “At most 16 addresses”.
After hairpin the mail server accepts messages it should not. See the “Warning” box of step 6: the server sees everyone as 192.168.10.1. Switch hairpin off, save and apply, and use local DNS.