Wildcard A record not resolving to main domain [RESOLVED]

I have four domains. Each has a * A record. Example for one domain below. I would expect that going to any subdomain other than blog should resolve to benmillett.us. However, any (fake) subdomain for any four of my domains resolves to agifforyou.com, which is the first domain alphabetically. I can set up .htaccess rules to redirect for each site, but I thought that DNS * A record was supposed to take care of that. What am I missing?

; benmillett.us [761605]
$TTL 86400
@    IN  SOA ns1.linode.com. me.benmillett.us. 2016081669 14400 14400 1209600 86400
@        NS  ns1.linode.com.
@        NS  ns2.linode.com.
@        NS  ns3.linode.com.
@        NS  ns4.linode.com.
@        NS  ns5.linode.com.
@            A   xx.239.31.41
*        300 A   xx.239.31.41
blog            A   xx.239.31.41
@            AAAA    xxxx:3c00::f03c:91ff:fea8:6409
*        300 AAAA    xxxx:3c00::f03c:91ff:fea8:6409
blog            AAAA    xxxx:3c00::f03c:91ff:fea8:6409

2 Replies

DNS simply points a domain or subdomain to an IP address.

What happens when a web request reaches a server is determined by the webserver configuration.

Apache loads virtual hosts in alphabetical order, and the first one becomes the default. If you want benmillett.us to be the default, you can edit the config file name so that it becomes the first in alphabetical order, e.g., 00-benmillett.us or aa-benmillett.us.

Thank you @sleddog! Due to other vhost issues I was having, I changed agifforyou.com.conf to gifforyou.com.conf just to move it below benmillett.us. I also updated the .confs so that the server aliases were *.domain. Now they resolve to the right domain.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct