Owen Smith wrote: > Windows by default ignores a TTL of zero and will cache the IP address > anyway. Windows DNS caching assumes that DNS to IP address mappings > hardly ever change.
Some experiments. This is from my own 'C' HLS decode program running on both win7 and my ARM/linux NAS. The HTTP code is my own using C sockets (maps to winsock on windows). DNS lookups happen using the standard getaddrinfo() function. I have no access to DNS TTL, but I can see (from the time taken by getaddrinfo) when the address is returned from the OS cache or when there is a real external DNS lookup. On the win7 machine there is clear caching of the DNS information - the external DNS lookups happen approximately every 20s, sometimes a bit more frequently, which is consistent with the TTL I see with the LMS network.asyncdns logging. The external DNS lookups vary between about 20ms and 70ms on this machine. On the ARM linux machine, there is no DNS caching in the OS, and all calls to getaddrinfo result in an external DNS lookup. These take around 70ms consistently. I'm seeing the IP address change quite frequently, often from one chunk fetch to the next, and certainly within the TTL of the DNS lookup inferred from the windows machine. So one conclusion is that windows7 is correctly respecting the DNS TTL information. Perhaps this is something they've fixed since WHS v1/Windows Server 2003 that you use? Another conclusion is that I've probably got a reliable broadband connection for DNS lookups, despite the fact that it barely manages 2Mbps. The other thing is that I see no evidence of the zero TTL lookups that off-tune from the BBC blog says he is seeing, but I'm not logging at the router so the effect of those could be masked in my results somehow I suppose? Finally, the results from the ARM machine show that the IP address can actually change much more frequently than the TTL suggests. I suspect that ignoring the DNS TTL and simply assuming a TTL of 20s every time will give perfectly reliable results. In fact I've just hacked my Slim/Networking/Async/DNS.pm to force a minimum TTL of 60s, and it's working fine. ------------------------------------------------------------------------ utgg's Profile: http://forums.slimdevices.com/member.php?userid=40900 View this thread: http://forums.slimdevices.com/showthread.php?t=53229 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
