Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network?

StackOverflow https://stackoverflow.com/questions/20862705

Вопрос

Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network?

I have an application server that is will be connecting to a mongodb server running on a separate instance, but the same local network. Is there substantial overhead for the DNS lookup?

For example:

[ app ] -- 1.1.1.1:27017 --> [ Mongo ]

VS

[ app ] -- mongo.example.com:27017 --> [ Mongo ]

EDIT

Is it generally considered a best practice to use the IP Address instead of the Domain name?

More info:

Thank you!

Это было полезно?

Решение

There will be an occasional, possibly significant, delay to look up the name. But the result will then be cached on any decent OS, so most connections won't have to wait on a DNS lookup.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top