Forum Discussion
Chris_Roy_10356
Nimbostratus
Jul 26, 2006DNS Rewrite
Is there any way to hijack a DNS request or rewrite a DNS response through an LTM iRule?
I'm trying to get DNS to respond to internal requestors with a private NAT address (that may or may not be on the BigIP) for an Internet host that would ordinarily return a public address. I am able to do this in GTM through a WideIP with multiple aliases (so we can keep them all in one place) and the following iRule:
when DNS_REQUEST {
if {[IP::server_addr] equals "10.1.2.1"} {
switch [DNS::rrname] {
www.a.com { host 10.1.1.1 }
www.b.com { host 10.1.1.2 }
}
}
}
Unfortunately, I need to add another listener to GTM and send all of my outbound requests there to catch just a few hosts. I would rather have an LTM iRule that I could put on my outbound Network VS for udp:53 that could do the dirty work without changing the DNS server config. I have some iRule command references that indicate DNS commands exist (or existed at some point), but my BigIP running 9.2 doesn't seem to want to recognize them.
Any help or clarification is appreciated...
- Colin_Walker_12Historic F5 AccountYou could certainly write an iRule on LTM to grab the traffic heading outbound and re-write the payload contents to use the response address you want. It just wouldn't be quite as straight-forward as on GTM. You'd have to do some string matching (regex, scan, etc.) against the payload and then rewrite where necessary.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects