Mar 21
CFHTTP Caches DNS Lookup
Posted by James Netherton | Wednesday 21 March 2007 8:31 PM | In ColdFusion
I seem to be getting my fair share of weird issues to solve at work lately. Today I came across some odd behavior with CFHTTP. I was hooking into a XML HTTP service and everything was working fine until I migrated the application to a production web server which runs CFMX 6.1.
Then, the CFHTTP call to the XML service stopped working. I couldn't get any response other than "connection failure". I was totally baffled as I tested the application on other servers and verified the web server could resolve the URL that I was using.
To cut a long story short, using the target ip address in place of the DNS name, solved the problem. I did some searching around to see what may have been the issue and came across these articles:
Changing CFHTTP DNS Caching Behavior
So you can see, Java caches the DNS lookup forever, until you recycle the ColdFusion service.
Something to be aware of when using CFHTTP.
1 Comment
[Post comment]
1
Posted by Jose Galdamez | Monday 03 December 2007 10:37 AM
I am having this same problem at work. I use CFHTTP to pull HTML from the previous page and create a print-friendly version. It worked fine when we were using the testing server, but when we switched production servers it stopped working. I'll see if your suggestion fixes the issue for now.