this seems really simple, but I can't figure it out. I'm using xname.org since it's free and I own a bunch of domains spread over a few different registrars.
The setup I desire is very simple: one A record that points the bare domain name to my server, plus a wildcard CNAME record pointing all subdomains to the same server.
So if the user goes to domain.com it will point them to 285.24.435.75, if they go to www.domain, blah.domain.com, or any other sub domain, they'll get sent to 285.24.435.75.
All the examples I read on the internet about setting up A records all have the A record set to a subdomain such as www. WWW is deprecated so I want to have noting to do with it. Currently my xname.org zone looks like this:
$TTL 86400 ; Default TTL
domain.com. IN SOA ns0.xname.org. nbvfour.gmail.com. (
2010052503 ; serial
10800 ; Refresh period
3600 ; Retry interval
604800 ; Expire time
10800 ; Negative caching TTL
)
$ORIGIN domain.com.
IN NS ns2.xname.org.
IN NS ns0.xname.org.
IN NS ns1.xname.org.
@ IN A 65.49.73.148
* IN CNAME domain.com
The '@' symbol is something that the godaddy domain interface uses to mean "this root domain', but that may have been specefic to that interface and has no meaning here.
Before I had a 'www' entry in the A rcords and it worked in the sense that I could ping 'www.domain.com' and it returned a response, but pinging the root domain 'domain.com' returned "no host found".
Notwithstanding the trailing dot error pointed out by Michael, my personal preference is not to
CNAME
a record pointing back at the domain itself.The reason for this is that it (unintentionally) exposes any
MX
,NS
orSOA
(etc) records for all of those new entries which could potentially have unintended consequences.Therefore, I would write your last two lines simply as:
First: @ is a standard "master file format" thing. It means "the current zone."
Your problem is simple. Add a '.' to the last line. that is, you want:
The tailing '.' at the end of the name means "do not append the current origin name to this"
If you leave it off, you get (in this case) "domain.com.domain.com."