DNS overrides are a quiet but powerful interception technique. They let you reroute traffic at the network layer without touching the client, the resolver, or the hosts file, which is invaluable when chasing down environment specific bugs.
Use spoofDnsAction to force Fluxzy to dial a specific IP and port for matching exchanges, regardless of what the operating system resolver returns. This is the equivalent of editing /etc/hosts but scoped to a single proxy session and selectable per host or path. Common scenarios:
127.0.0.1.You can override only the IP, only the port, or both. The host name presented to the server (and used for SNI) stays the one the client originally asked for, which keeps TLS validation working as long as the certificate is valid for that name.
Send every request for api.example.com to a local mock listening on port 8080 without touching the client configuration.
rules:
- filter:
typeKind: HostFilter
pattern: api.example.com
actions:
- typeKind: SpoofDnsAction
remoteHostIp: 127.0.0.1
remoteHostPort: 8080
Keep the original port the client requested, only override the IP so traffic reaches the staging machine.
rules:
- filter:
typeKind: HostFilter
pattern: cdn.example.com
actions:
- typeKind: SpoofDnsAction
remoteHostIp: 10.0.0.42
Used together with skipSslTunnelingAction when the local listener does not speak TLS.
rules:
- filter:
typeKind: HostFilter
pattern: events.example.com
actions:
- typeKind: SpoofDnsAction
remoteHostIp: 127.0.0.1
remoteHostPort: 9000
- typeKind: SkipSslTunnelingAction
Fix statically the remote ip or port disregards to the dns or host resolution of the current running system. Use this action to force the resolution of a hostname to a fixed IP address.
Evaluation scope defines the timing where this filter will be applied.
onAuthorityReceived This scope denotes the moment fluxzy is aware the destination authority. In a regular proxy connection, it will occur the moment where fluxzy parsed the CONNECT request.
spoofDnsAction
This action has no specific characteristic
The following examples apply this action to any exchanges
Force the remote IP and port to be respectively 127.0.0.1 and 8080.
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: SpoofDnsAction
remoteHostIp: 127.0.0.1
remoteHostPort: 8080
Force the remote IP to be 127.0.0.1 (port remains the same as request by the client).
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: SpoofDnsAction
remoteHostIp: 127.0.0.1
Force the remote port to be 8080 (IP remains the same as request by the client).
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: SpoofDnsAction
remoteHostIp: 127.0.0.1
View definition of SpoofDnsAction for .NET integration.
The following actions are related to this action:
No. The hostname presented to the server stays untouched. Only the destination IP and port used for the TCP connection are overridden.
TLS validation runs against the original hostname. If the IP you target serves a certificate that does not match that name, the handshake fails unless you also enable skipRemoteCertificateValidationAction.
Yes. Combine the action with a scheme aware filter such as isSecureFilter to restrict the override to HTTP or HTTPS exchanges.
It is more flexible. You can scope by host pattern, port, process name, or any other filter, and the override only lasts as long as Fluxzy is running with the rule loaded.