# Setting up DNS alias records



## MMacD (Sep 28, 2017)

Apologies if this should be in the ports (I'm using nsd) or networking sections; please feel free to move it, if so.

I want both "momcat" and "www" to resolve to the same IP (192.168.0.96 at present).  If I'm right (please correct me if I'm not!), this should resolve correctly in the forward direction:

```
momcat          IN      A           192.168.0.96   ; server of all work
www               IN     CNAME   momcat           ; when in role of (toy) webserver
```

But I haven't a clue how to set up for the reverse direction, or whether that's even possible.  The base reverse record seems to be

```
96                  IN     PTR         momcat.local.lan.
```
Is there some syntax that would allow a random return of either "momcat" or "www", or is a reverse lookup always meant to return the base A name rather than a/the CNAME name?


----------



## SirDice (Sep 28, 2017)

MMacD said:


> But I haven't a clue how to set up for the reverse direction, or whether that's even possible.


It's simply not possible. Reverse resolving should always only return one (and the same) result. 



MMacD said:


> or is a reverse lookup always meant to return the base A name rather than a/the CNAME name?


You typically return the host's fully qualified name, not its CNAME.


----------



## MMacD (Sep 28, 2017)

Thank you!  I suspected as much, but thought I'd better ask!


----------

