Sunday, September 21, 2014

how do you add an A record for a root domain




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".


Answer



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:



* IN CNAME domain.com.



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."


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...