Forum Discussion
meena_60183
Nimbostratus
Jun 09, 2009reverse DNS lookup on iRule
Hi All,
I have the following requirement. The apache web server currently has the logic.
. port 80 and DNS match
When users come in on port 80 and the reverse DNS lookup on the client IP contains xxx.com, it sends the traffic to port 8080 on the web server.
. port 443 and DNS match
when users come in on port 443 and the reverse DNS lookup on the client IP contains xxx.com, it sends the traffic to port 8443 on the web server.
. port 80 and DNS mismatch
When users come in on port 80 and the reverse DNS lookup on the client ip is not xxx.com, redirect to port 8443 on the server.
.port 443 and DNS mismatch
When users come in on port 443 and the reverse DNS lookup on the client ip is not xxx.com, send it to port 8443 on the server.
Can this be done using iRules? Only piece that I do not know is how to do the reverse lookup using the DNS server.
Meena
- The_Bhattman
Nimbostratus
Yes I believe it can be done. - meena_60183
Nimbostratus
Thank you for the response. I tried the irule and I did not get the resolved name. I logged the client IP - Wintrode_61162
Nimbostratus
I am seeing the same behavior. I never see the DNS query leave the F5. I must be missing something. It takes a full 20 seconds, so it looks like it is timing out trying to do the lookup. I also do not see any traffic leaving the F5 on 53 when running tcpdump. When I just do a lookup from the CLI, I see everything fine. - hoolio
Cirrostratus
Do you have a TMM route for the DNS server? TMM won't be able to use a DNS server on the management interface. - Wintrode_61162
Nimbostratus
There is no specific route to the DNS server, but the default route should get it there ( I can ping the DNS server from the self IP). - hoolio
Cirrostratus
Is there a TMM default route which allows you to reach the DNS server? Pinging from the command line can use mgmt routes. RESOLV::lookup will show the same issue as TMM tries to do the DNS query. - Wintrode_61162
Nimbostratus
There is a default route defined in TMM. The issue looks to be that when executing RESOLV or NAME without specifying a DNS server, it goes nowhere. I thought it would have used the DNS servers defined on the TMM. Was this a false assumption? - hoolio
Cirrostratus
I didn't think you'd have to specify a DNS server in either command. But if it works with a virtual server or explicit IP, I say go for it :) If you want to use a pool of DNS servers, you can define a virtual server pointing to that pool and then use the virtual server name in the RESOLV::lookup command. - Wintrode_61162
Nimbostratus
Exactly Aaron. Thanks for the help. - hoolio
Cirrostratus
The -ptr issue with RESOLV::lookup was fixed in 10.2.1HF1. You can download the latest 10.2.1 hotfix from downloads.f5.com.
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