How can I override TTL of an Internet Address?
CAN this be done? Sure - there are broken DNS servers (e.g. the ones AOL runs) that do this, and every admin I know hates it.
SHOULD this be done? Almost certainly no.
Generally speaking the TTL was set to a particular value for a reason (in google's case, probably fault tolerance: You'll only be unable to reach google for 5 minutes if that server blows up), and you shouldn't muck about with it.
You're already getting a performance boost by keeping the google.com record in your cache for the 5 minutes it's intended to live for since your individual workstations won't be running out to the internet for resolution -- don't over-optimize and break the expected behavior :)
the DIRTIEST most ugliest thing that can be done is...
1-Downloading the source 2-find the file called cache.c 3-find the function is_expired
4- Change it in this way
static int is_expired(time_t now, struct crec *crecp)
{
if (crecp->flags & F_IMMORTAL)
return 0;
if (difftime(now, crecp->ttd) < 0)
return 0;
return 0; // IT WAS IN ONE
}
When the function ask did expire? we always saw no
In this way it will never expire and you will conquer the world.
OUTPUT:
; <<>> DiG 9.6.1-P2 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28477
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 603937 IN CNAME www.l.google.com.
www.l.google.com. 4294966733 IN A 209.85.195.99
www.l.google.com. 4294966733 IN A 209.85.195.104
www.l.google.com. 4294966733 IN A 209.85.195.147
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Feb 17 18:34:47 2010
;; MSG SIZE rcvd: 110
If you're really interested in history rather than accuracy, the quickest dirtiest hack you can do is probably make your name server an authoritative master for the domain and recreate the zonefile as frequently as needed through a script. Definitely only recommended for taking over the world though, not for real life.
In general if you really want a record of very short TTL to persist within an application, it seems the only sensible way is to cache it within the application.