2

I am creating a DNS A Record via the Google Cloud API, ending up with:

  • DNS Name: some-subdomain.mysite.io
  • Type: A
  • TTL: 1
  • IP: 35.XXX.XXX.XX

After the entry is confirmed as created and viewable in the API, I am trying to resolve it using nslookup, but I get:

$ nslookup some-subdomain.mysite.io
 Server:        192.168.178.1
 Address:   192.168.178.1#53

** server can't find some-subdomain.mysite.io: NXDOMAIN

It stays like this for a few minutes, until it eventually resolves.

Because the first lookup is after it's been created, I'd expect it not to miss (And therefore have no miss to cache). Is there anything I can do to make the lookup succeed sooner?

3 Answers3

4

If you do the query just before creating the record you pollute the cache with a NXDOMAIN return code for the record for a delay called the negative TTL which is specified in the SOA record (last item).

Also, you should not use nslookup for DNS diagnostics, but dig and you should always specify the nameserver your query, to make sure to separate results coming from the authoritative nameservers with those being cached somewhere in a recursive nameserver.

Patrick Mevzek
  • 10,581
  • 7
  • 35
  • 45
1

You create A Record via the Google Cloud API and start to resolve it. But you don't know how often Google update it's DNS configuration, may be it take few minutes to update zone configuration, that's why it not resolving for few minutes.

If you want know more about DNS work, you could read this article or check this comics, for example.

1

The solution we came up with was to use a wildcard DNS entry. So now I have an entry:

*.mysite.io -> 10.XX.XX.XX

This means any sub domain we create is resolvable immediately as the DNS already exists. We then route internally based on the host header.