Salta al contenuto

Alias on *.domain.tld overriding IN A on staging.domain.tld?

0

Hi,

we have set up an IN A with an ALIAS for *.domain.tld pointing to our Elastic Beanstalk environment. Since we're hosting our staging (and dev) environments somewhere else at the moment, we want some subdomains pointing to another IP address:

domain.tld IN A -> ALIAS our EB env
*.domain.tld IN A -> ALIAS our EB env
staging.domain.tld IN A -> IP address of our staging environment
*.staging.domain.tld IN A -> IP address of our staging environment

From what I (thought I) know about DNS, shouldn't staging.domain.tld beat *.domain.tld and thus a query for staging.domain.tld should return the IP address of our staging environment?

Instead we get this:

# dig staging.domain.tld

;; QUESTION SECTION:
;staging.domain.tld.		IN	A

;; ANSWER SECTION:
staging.domain.tld.	14399	IN	CNAME	xxx.eu-central-1.elasticbeanstalk.com.

What's even more confusing is that if I query one of the AWS name servers directly, the result is fine:

# dig staging.domain.tld @ns-902.awsdns-48.net

;; QUESTION SECTION:
;staging.domain.tld.		IN	A

;; ANSWER SECTION:
staging.domain.tld.	300	IN	A	xxx.xxx.150.143

It doesn't seem to matter what other name server I try - I checked 8.8.8.8 and 9.9.9.9, from various VPS hosted with different hosters and from two different cable and mobile data providers - all except for the AWS DNS return the incorrect alias / CNAME.

All records were made more than 24 hours ago...

I'd appreciate any help. Thanks in advance!

posta 7 anni fa273 visualizzazioni
2 Risposte
0

DNS doesn't work that way. There is no evaluative logic that exists the way it might for networking CIDR blocks or the like.

You can't reliably have *. and staging. for the same domain.
I suggest modifying your DNS or routing all *. to a load balancer than can then use Application Delivery Control (e.g. in ALB, it would be using rules based on host) for routing.

con risposta 7 anni fa
0

DNS does work that way. Wildcards can get complicated, but having "*.example.com" and "foo.example.com" is fine and can work reliably.

I just tried it with Route 53 -- using non-alias TXT records -- and it worked fine.

There might be a caching issue, or some other misconfiguration, or maybe a limitation with Route 53 alias records, but in general it's fine.

con risposta 7 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.