Score:0

Better option for DNS for large no of records

bv flag

I have a app and say in the app new objects can be created. When ever a new object(eg: say hello) is created i want the url hello.example.com/hi to point to a specific IP always.

Found there are three ways to achieve this. Want to know in case of large no of DNS entries will there be a delay and which of the below approaches would work best.

  1. Add a DNS entry *.example.com ----> IP_1

Problem with this is this will redirect unwanted dns also to IP_1

  1. Each time a new object is created, run a script and add specific dns dynamically

    hello.example.com ----> IP_1 hi.example.com -----> IP_1 .......

    So there will be a lot of mappings One doubt I have is if the no of mappings increase a lot will the lookup time increase and cause delay

  2. Using multi level

    *.object.example.com ------> IP_1

djdomi avatar
za flag
you have only two options imho, use a domain with wildcard Or you have to set the dns names. dns only work like a yes or no system. meaning either it exists or even not but there is nothing between
Nikita Kipriyanov avatar
za flag
"A lot" of mappings is how many? If that's around a thousand it's absolutely not "a lot". DNS servers implement indexed database engines to retrieve records, and generally speaking, you won't be able to make so many records so to notice how it slows down. That requires literally millions of them.
paladin avatar
id flag
Please reformulate your question and fix your typographic errors.
Score:4
ws flag

Your concerns with both approaches are unfounded.

[wildcard DNS record] will redirect unwanted dns also to IP_1

  • So what? If you want multiple DNS records, this implies that you are running services which are hostname aware (e.g. http, smtp) You still need to configure the hostname-specific behaviour to those services.
  • You can mix explicit DNS records with a wildcard - the DNS server should return the most specific match

if the no of mappings increase a lot will the lookup time increase and cause delay

Only if you run a really badly written DNS server. Bind and powerDNS would have no issue with this.

If you do decide to use explicit records rather than wildcards (although arguably it still might be a good idea for wildcards) is to create the new records as CNAMEs rather than A records - it does simplify the maintenance / migration.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.