0

I subscribed for a domain name and now I can edit the zone file using the registrar's web interface.

I would like to redirect everything (mydomain.com, xxx.mydomain.com, etc.) to the same IP address except a specificprefix.mydomain.com which should point to another IP.

I thought this would be OK but unfortunately specificprefix.mydomain.com also points to the first IP.

Here's my DNS zone file:

* 10800 IN A <FIRST_IP>
@ 10800 IN A <FIRST_IP>
specificprefix.mydomain.com 10800 IN A <SECOND_IP>

(then some mail stuff that I don't think related)

What's wrong here?

nicoco
  • 147
  • 2
  • 2
  • 8

1 Answers1

2

You probably need to add a dot (.) at the end of the FQDN on the 3rd line.

If this is a bind zone file (or equivalent), $ORIGIN is added to the end of any non-FQDN hostname. (one that doesn't end in a dot). By default $ORIGIN is the domain name, so mydomain.com in your example.

You're first line doesn't end in a dot, so is expanded to *.mydomain.com. which is what you want.

The second line contains @ which specifically means "origin", so mydomain.com..

The third line has a hostname specified, but doesn't end with a dot so expands to specificprefix.mydomain.com.mydomain.com.. You can probably ping that and get your second ip returned...

USD Matt
  • 5,321
  • 14
  • 23
  • Indeed! `specificprefix.mydomain.com.mydomain.com` points to ``. For some reason the registrar's web interface wouldn't let me add the dot at the end, but I replaced `specificprefix.mydomain.com` by `specificprefix`. We'll see if it works in a few hours, but I'm pretty confident. Thanks! – nicoco May 15 '17 at 13:17