Set CNAME locally on OSX

2

I am trying to get my Mac to resolve abc.com to xyz.com.

Tried in /private/etc/hosts:

abc.com xyz.com

and

abc.com in CNAME xyz.com

Neither works. Anyone know how to do this?

exolab

Posted 2012-03-02T20:08:11.973

Reputation: 335

1You probably want to add a local dns server to your computer, look into dnsmasq. – Camden Narzt – 2017-01-07T18:08:53.967

Answers

2

Well, the hosts file is formatted as "IP_address hostname..." (as many hostnames as you need), so you could put the ip, followed by both abc.com and xyz.com. It's not designed to work as a local CNAME. It's a local resolver (think A record type action)...

Brian Knoblauch

Posted 2012-03-02T20:08:11.973

Reputation: 4 313

1I am trying to resolve an address on heroku, not sure if the ip address does not change... – exolab – 2012-03-02T20:23:52.627