A recording master station (corresponding to IPv4) @ host record (to resolve without www primary domain name) to IP
Master CNAME records (alias) www host record (to resolve the www primary domain) to example.com
Redirect station:
CNAME, www host record resolves to the main domain name
A, host records to resolve IP @
IP server corresponding to the master station to do 301 redirect.