
Ask HN: I have an idea to fix the DNS change problem - babuskov
Hi,<p>I&#x27;m migrating one of my websites to a new IP address and of course I&#x27;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:<p>A new HTTP response code would be added to mean &quot;Please refresh your DNS cache because this site has moved servers&quot;.<p>When the browser sees this response, it would ask its DNS to update the cached entry with the new address.<p>Are there any drawbacks to this?<p>Who can I contact to suggest this addition into HTTP protocol?<p>Thanks.
======
rahimnathwani
'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
Alright, 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
Is 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
It'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.

------
jlgaddis
Start here:
[http://permalink.gmane.org/gmane.network.dns.operations/5019](http://permalink.gmane.org/gmane.network.dns.operations/5019)

------
iMerNibor
If 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
This 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.

