0

I'm trying to speed up my webpage load time in distant locations.

My server is located in Germany and I installed the second one in LA, CA.

Then I configured BIND to return LA IP for clients from Americas and German IP for clients from Europe and Asia.

Though it seems there is still room to reduce response time by some dozens of ms with DNS and name servers.

At the moment both name servers which serve my domain name are located in Germany which from my understanding causes delays for clients who has no dns cache for my domain. Am I right here?

  • If I will move one of name servers to LA will in reduce DNS resolution time?
  • How name server to query is chosen during name resolution?
  • E.g. specified two NS: ns1.domain.com which is in DE and ns2.domain.com which is in US. which one will be queried? Will it help to specify IP instead of ns1.domain.com?
rush
  • 1,961
  • 2
  • 15
  • 22
  • 5
    Why not use something like AWS Route53 and let someone else worry about it? Take advantage of their 50-ish global datacenters. Globally distributed DNS isn't a simple task to do on your own, particularly routing the queries to the closest DC. – ceejayoz Nov 11 '15 at 00:27

2 Answers2

2

I agree with ceejayoz's comment: if international presence is a concern, you should use a DNS provider with an international presence. In practice that is the only cost effective solution for the concern you are addressing. That said, what you primarily get out of an international DNS presence isn't low response time but reliability, as your presence is less likely to be impacted by major routing problems between regions.

  • Due to DNS caching that should be happening at the ISP level for most of your clients, trying to optimize DNS to achieve faster page load time is usually a misguided concern. Once the DNS record has been looked up, subsequent requests are remembered by the remote server for a period of time tied to the record TTL. Make sure you have identified an actual issue before proceeding in this direction. (is DNS really the problem here? how much of a delay is there? is this really a network problem?)
  • DNS is designed for low latency and fault tolerance. Unless one of the DNS servers is returning bad data, or the design behind your DNS infrastructure itself is flawed, the performance gains from tackling this problem with infrastructure that you operate is not very cost effective.
  • The authoritative nameserver chosen is random. Unlike a DNS forwarder (usually set up on your private network), most recursive/caching DNS servers will not attempt to remember which authoritative server returned the fastest response for a domain. They will be trying to avoid communicating with more than one of your nameservers unless the first one attempted is not responding promptly. They will remember if a server does not respond to a request, but not for a period more than five minutes, and only the failed request will not be re-attempted against that server. (others are still fair game)

From my experience, in most cases people in your situation are chasing a red herring by trying to solve this problem. If you aren't, there is a problem with the DNS servers themselves, how well they're operated, or the network that they sit on.

For all of the reasons above, we strongly encourage people not to run their own authoritative DNS servers.

Andrew B
  • 31,858
  • 12
  • 90
  • 128
1

If I will move one of name servers to LA will it reduce DNS resolution time?

"It depends": For machines querying this nameserver, which are located in LA: yes. For machines querying this nameserver, which are located, for example, in Germany, it will increase resolution time.

If you want to check where the querying machines are located, and hand out the topologically nearest nameserver, you would have to introduce for example Anycast, which "is a network addressing and routing methodology in which datagrams from a single sender are routed to the topologically nearest node in a group of potential receivers, though it may be sent to several nodes, all identified by the same destination address."

How name server to query is chosen during name resolution?

AFAIK, it's random. You can't predict this in advance.

E.g. specified two NS: ns1.domain.com which is in DE and ns2.domain.com which is in US. which one will be queried? Will it help to specify IP instead of ns1.domain.com?

Sometimes you will get an answer from ns1.domain.com, sometimes from ns2.domain.com. You can't predict or influence this.

According to RFC 1035, the data of an NS record is "A domain-name which specifies a host which should be authoritative for the specified class and domain.". So you can't use an IP instead of ns1.domain.com.

Edit: Maybe the threads Practical Anycast and/or How can I send visitors to the closest server using DNS? are of help for you too.

gxx
  • 5,483
  • 2
  • 21
  • 42