Advanced IPv4 controls · Simple VPN and DNS policies
Keep selected applications on their assigned VPN for both DNS and payload, while ordinary applications retain normal direct DNS and payload. A failure of one DNS context must not stop the other.
Read Prepare an Advanced IPv4 Deployment, Repair Windows and Health Checks, and Operate, Restart and Withdraw alongside this guide. These advanced examples use dedicated systemd-managed OpenVPN instances; the simple walkthrough remains a separate alternative.
Follow the shared Ubuntu 24.04 implementation walkthrough for this use case: configuration, source build, guarded installation, controlled handoff, operating commands and rollback. Select ipv4 and this case in the source bundle. The policy below supplies its DNS scope, application boundaries and permitted failure behavior. OpenVPN Community 2.6 is the reference; exact-build capability checks remain required. Linux execution is deferred.
Define the policy
| Traffic | Required provider/path |
|---|---|
| Selected application DNS | VPN resolver through VPN A |
| Other application and host-service DNS | Designated normal resolver directly |
| Selected application payload | VPN A |
| Other application payload | Direct |
DNS scope: Split by application group. This covers conventional upstream unicast DNS in the declared host contexts. Controlled application resolution is required; port-53 filtering alone does not establish that arbitrary encrypted DNS or proxies cannot bypass it. Local stub access is not a separate upstream permission. Protected IPv6 is blocked during this IPv4 phase; the later IPv6 series is separate.
The two permissions for an application are independent. Losing DNS does not revoke healthy known-address payload, and losing payload does not revoke healthy DNS. A common tunnel, physical underlay or protection failure can affect both when both actually depend on it.
Prepare this use case
-
Inventory the selected application identities and give that group its own resolver context. Record ordinary applications and host services against the normal DNS context; a local shared stub must not collapse the two selections.
-
Assign the selected DNS provider to VPN A and the normal provider to its direct path. Declare both permitted destinations explicitly. Selected DNS must never inherit the ordinary resolver after a lookup failure.
-
Bind selected payload to VPN A. Keep DNS and payload permissions separate even though they share that tunnel. A session-level failure affects both; a remote resolver failure affects only DNS.
Complete the deployment worksheet with the shared preparation inventory. It is documentation data, not a loadable configuration. Retain the simple counterpart as an alternative; do not run its mode-switch helper beside the advanced owner.
Activate and observe
Follow the closed-first activation sequence. Install and verify the independent route restrictions before any controlled transport attempt or application grant. Admit only the named OpenVPN instance and numeric peer needed for this use case. Then qualify each DNS/payload class separately and read back the actual resolver/route selection in its client context.
At startup, each permitted class must release before its fifteen-minute allowance expires. Successful release begins its own 120-second confirmation. Record the selected provider, class state, OpenVPN invocation, current checks, attempt count and remaining authority; an interface or an “active” service alone does not prove useful traffic is flowing.
Respond to failure
| Observed condition | Required behavior |
|---|---|
| VPN DNS fails; VPN A payload remains healthy | Deny selected DNS. Continue selected known-address payload, normal DNS and normal payload. |
| Normal DNS fails | Deny normal DNS only. Preserve the selected VPN DNS context and both healthy payload paths. |
| Selected payload check fails; DNS works | Deny selected payload only. Keep both DNS contexts available. |
| VPN A session fails | Deny selected DNS and payload because both use it. Preserve independently healthy ordinary direct traffic. |
Unavailable, degraded and unknown required service all invoke the relevant loss response. Keep static no-escape restrictions installed before detection, during repair and after lockout. Use the shared repair rules and report the actual failure reason. A remote DNS error does not automatically authorize a tunnel restart.
Work through one incident
At 00:00 the selected VPN resolver stops answering while VPN A still carries the permitted numeric payload check. Close selected DNS. An existing known-address connection may continue through VPN A, and ordinary lookups continue through normal DNS. Requalify the same VPN DNS path within its repair authority, then reopen only that DNS class. No whole-process pause is needed to enforce the failed lookup path.
These are constructed operating examples. They are not measured Linux timings. Check failures, expired evidence, failed publication or unknown controls can close the relevant class earlier than an outer repair deadline.
Return, restart and withdraw
There is no DNS fallback or provider-selection variant. Restore the same failed context, independently of the other context and payload.
An explicit operator recovery restart or host boot may replenish the affected allowance once while preserving provider selection and manual holds. Automatic crash/reconnect loops retain counters. Revalidate each class before reopening; restoring a saved provider is not restoring a saved health result. Follow the restart procedure and withdrawal sequence. Close and verify the owned gates before removing owned policy; never fall through to an unapproved route during rollback.
Check the boundary before acceptance
Attempt selected DNS through the ordinary resolver while selected DNS is held. It must remain denied even though ordinary applications can use that resolver. Reverse the DNS fault to verify that normal-DNS loss does not close selected VPN DNS.
Apply the shared IPv4 failure and acceptance procedure, including existing connections, application-context lookups, stale events, crash/boot resets and expired permissions. Record actual route/packet evidence and state transitions separately. These checks remain unexecuted on Linux.