8 ms·
Ask HN: I have an idea to fix the DNS change problem
Hi,
I'm migrating one of my websites to a new IP address and of course I'm running into problem because the change was not planned and DNS takes a long time to update. I have suddenly got an idea how this could be easily solved, so I want to see what you think about it:
A new HTTP response code would be added to mean "Please refresh your DNS cache because this site has moved servers".
When the browser sees this response, it would ask its DNS to update the cached entry with the new address.
Are there any drawbacks to this?
Who can I contact to suggest this addition into HTTP protocol?
Thanks.
- jlgaddis 11y agoStart here: http://permalink.gmane.org/gmane.network.dns.operations/5019 http://permalink.gmane.org/gmane.network.dns.operations/5019
- deleted 11y ago[deleted]
- rahimnathwani 11y ago'Are there any drawbacks to this?' Yes! 1) DNS already has a mechanism for this. As soon as you know a change might be coming, reduce the TTL for the hostname(s), so that your yet-to-be-decided change is propagated quickly when the time comes. Totally unplanned changes (e.g. I decide on a whim that I need to change the IP addresses for my web site) are rare. 2) The new feature would make DNS dependent on HTTP. 3) The web server has no way of knowing whether your DNS record(s) have changed. So, you'd need to tell it manually, or it would need to be linked to your DNS server, which is probably on a different machine. And, in any case, your web server shouldn't be dependent on your DNS server. 4) The responsibility of HTTP is to transfer pages, not to determine how DNS queries are handled. Your browser could be delegating DNS queries to some lower level system. Let's assume that (1) your web server is using HTTPS, and (2) you're connected to the web via a proxy server. Your proxy server is responsible for DNS, but your browser is meant to interpret the contents returned over HTTPS. How would your browser 'ask its DNS to update the cached entry'? You'd need to add another hack to HTTP, so that the browser could send some special message to the proxy, asking it to update its DNS cache. 5) You're trying to solve a 'problem' in one system (DNS) which covers only one of many use cases (HTTP). DNS is used to resolve hostnames for non-HTTP, and for other things like DKIM/SPF.
- jjoe 11y agoAlright, I'm going out on a limb to suggest we need an aggressive approach to DNS resolvers. Someone should build a RESOLVBL of resolvers that don't respect RR TTL. I'm certain resolvers will rethink their approach when end users complain.
- rahimnathwani 11y agoIs this a widespread problem? Is it mainly ISP's DNS servers which don't respect TTLs? Does anyone gain (e.g. by saving bandwidth) by caching DNS entries for longer?
- jjoe 11y agoIt's only a problem when you need to switch IPs urgently. Some browsers also maintain their own cache but it's not as aggressive as resolvers. Caching (e.g. overriding TTLs) cuts down RU on space, power, hardware, and latency (having to travel all the way down to the root NS for answers). There's definitely incentive in caching stuff.
- iMerNibor 11y agoIf the old web server is going to be up anyways, why not just reverse proxy responses to the new one using nginx for example?
- babuskov 11y agoThis is a great idea. In fact, I did this for one of my websites two years ago (using HAProxy) and I completely forgot about it until now. Thanks.