Set up DNS to forward mail to one domain and other traffic to another












0















I have a domain. I would like to forward mail to Google GSuite servers and web traffic to an Amazon S3 bucket. The S3 bucket has a fixed domain name, but not a fixed IP, so I can't use an A record. A CNAME record would sort the web stuff, but it would preclude the MX records for GSuite.



I've seen similar questions, and they advise using an A record instead of a CNAME. This would not work for me, because the Amazon S3 bucket does not have a fixed IP.



Is there a solution purely in DNS, or do I need to CNAME and then handle the mail on the S3 side?










share|improve this question























  • I think you are misunderstanding this. Add the CNAME records for yourdomain.com and www.yourdomain.com pointing to the S3 address and add the MX records for yourdomain.com pointing to gsuite. They are completely independent of one another. One does NOT “preclude” the other.

    – Appleoddity
    Jan 5 at 7:03













  • @appleoddity A CNAME kinda does preclude using an MX record actually. See my comment on your answer - there is a common misconception about how DNS works (and which has caught you out for the base domain)

    – davidgo
    Jan 5 at 9:35











  • @davidgo you’re right. Funny thing is, I literally just dealt with this issue earlier in the day and completely forgot about that. Thanks.

    – Appleoddity
    Jan 5 at 14:47
















0















I have a domain. I would like to forward mail to Google GSuite servers and web traffic to an Amazon S3 bucket. The S3 bucket has a fixed domain name, but not a fixed IP, so I can't use an A record. A CNAME record would sort the web stuff, but it would preclude the MX records for GSuite.



I've seen similar questions, and they advise using an A record instead of a CNAME. This would not work for me, because the Amazon S3 bucket does not have a fixed IP.



Is there a solution purely in DNS, or do I need to CNAME and then handle the mail on the S3 side?










share|improve this question























  • I think you are misunderstanding this. Add the CNAME records for yourdomain.com and www.yourdomain.com pointing to the S3 address and add the MX records for yourdomain.com pointing to gsuite. They are completely independent of one another. One does NOT “preclude” the other.

    – Appleoddity
    Jan 5 at 7:03













  • @appleoddity A CNAME kinda does preclude using an MX record actually. See my comment on your answer - there is a common misconception about how DNS works (and which has caught you out for the base domain)

    – davidgo
    Jan 5 at 9:35











  • @davidgo you’re right. Funny thing is, I literally just dealt with this issue earlier in the day and completely forgot about that. Thanks.

    – Appleoddity
    Jan 5 at 14:47














0












0








0








I have a domain. I would like to forward mail to Google GSuite servers and web traffic to an Amazon S3 bucket. The S3 bucket has a fixed domain name, but not a fixed IP, so I can't use an A record. A CNAME record would sort the web stuff, but it would preclude the MX records for GSuite.



I've seen similar questions, and they advise using an A record instead of a CNAME. This would not work for me, because the Amazon S3 bucket does not have a fixed IP.



Is there a solution purely in DNS, or do I need to CNAME and then handle the mail on the S3 side?










share|improve this question














I have a domain. I would like to forward mail to Google GSuite servers and web traffic to an Amazon S3 bucket. The S3 bucket has a fixed domain name, but not a fixed IP, so I can't use an A record. A CNAME record would sort the web stuff, but it would preclude the MX records for GSuite.



I've seen similar questions, and they advise using an A record instead of a CNAME. This would not work for me, because the Amazon S3 bucket does not have a fixed IP.



Is there a solution purely in DNS, or do I need to CNAME and then handle the mail on the S3 side?







dns






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 5 at 6:46









Thom SmithThom Smith

3971410




3971410













  • I think you are misunderstanding this. Add the CNAME records for yourdomain.com and www.yourdomain.com pointing to the S3 address and add the MX records for yourdomain.com pointing to gsuite. They are completely independent of one another. One does NOT “preclude” the other.

    – Appleoddity
    Jan 5 at 7:03













  • @appleoddity A CNAME kinda does preclude using an MX record actually. See my comment on your answer - there is a common misconception about how DNS works (and which has caught you out for the base domain)

    – davidgo
    Jan 5 at 9:35











  • @davidgo you’re right. Funny thing is, I literally just dealt with this issue earlier in the day and completely forgot about that. Thanks.

    – Appleoddity
    Jan 5 at 14:47



















  • I think you are misunderstanding this. Add the CNAME records for yourdomain.com and www.yourdomain.com pointing to the S3 address and add the MX records for yourdomain.com pointing to gsuite. They are completely independent of one another. One does NOT “preclude” the other.

    – Appleoddity
    Jan 5 at 7:03













  • @appleoddity A CNAME kinda does preclude using an MX record actually. See my comment on your answer - there is a common misconception about how DNS works (and which has caught you out for the base domain)

    – davidgo
    Jan 5 at 9:35











  • @davidgo you’re right. Funny thing is, I literally just dealt with this issue earlier in the day and completely forgot about that. Thanks.

    – Appleoddity
    Jan 5 at 14:47

















I think you are misunderstanding this. Add the CNAME records for yourdomain.com and www.yourdomain.com pointing to the S3 address and add the MX records for yourdomain.com pointing to gsuite. They are completely independent of one another. One does NOT “preclude” the other.

– Appleoddity
Jan 5 at 7:03







I think you are misunderstanding this. Add the CNAME records for yourdomain.com and www.yourdomain.com pointing to the S3 address and add the MX records for yourdomain.com pointing to gsuite. They are completely independent of one another. One does NOT “preclude” the other.

– Appleoddity
Jan 5 at 7:03















@appleoddity A CNAME kinda does preclude using an MX record actually. See my comment on your answer - there is a common misconception about how DNS works (and which has caught you out for the base domain)

– davidgo
Jan 5 at 9:35





@appleoddity A CNAME kinda does preclude using an MX record actually. See my comment on your answer - there is a common misconception about how DNS works (and which has caught you out for the base domain)

– davidgo
Jan 5 at 9:35













@davidgo you’re right. Funny thing is, I literally just dealt with this issue earlier in the day and completely forgot about that. Thanks.

– Appleoddity
Jan 5 at 14:47





@davidgo you’re right. Funny thing is, I literally just dealt with this issue earlier in the day and completely forgot about that. Thanks.

– Appleoddity
Jan 5 at 14:47










1 Answer
1






active

oldest

votes


















2














If you can use a subdomain (like www.example.com,) for your website, a CNAME is not a problem and co-exist with an MX record.



The solution I use where I need to resolve example.com (as well as www.example.com) is a minimal server on a known static IP (so I can use an A record) which does a redirect to the www site. This logic is trial for http. While it can work for https it's a bit harder as you need a cert for example.com on the redirect server.



Another possibility which is not as general (,ie AWS specific) is to migrate your domain name to Amazon's Route53 service and use an "alias" record for example.com. An alias record is not a "real" DNS record, but Amazon DNS servers "flatten" an Alias so it is programmed like a CNAME but underneath it converts the record to an A record - which they can do because they control the environment.



Your third option would be to build a dynamic DNS type service that your host updates a DNS A record each time it starts/the IP changes and you run a very low TTL so changes are propogated quickly.



For the sake of clarity, you can point the MX record to a place other then Amazon, you just don't want to use a CNAME at the same or lower "subdomain level" then the MX record.






share|improve this answer


























  • I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

    – Thom Smith
    Jan 5 at 15:23











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390807%2fset-up-dns-to-forward-mail-to-one-domain-and-other-traffic-to-another%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














If you can use a subdomain (like www.example.com,) for your website, a CNAME is not a problem and co-exist with an MX record.



The solution I use where I need to resolve example.com (as well as www.example.com) is a minimal server on a known static IP (so I can use an A record) which does a redirect to the www site. This logic is trial for http. While it can work for https it's a bit harder as you need a cert for example.com on the redirect server.



Another possibility which is not as general (,ie AWS specific) is to migrate your domain name to Amazon's Route53 service and use an "alias" record for example.com. An alias record is not a "real" DNS record, but Amazon DNS servers "flatten" an Alias so it is programmed like a CNAME but underneath it converts the record to an A record - which they can do because they control the environment.



Your third option would be to build a dynamic DNS type service that your host updates a DNS A record each time it starts/the IP changes and you run a very low TTL so changes are propogated quickly.



For the sake of clarity, you can point the MX record to a place other then Amazon, you just don't want to use a CNAME at the same or lower "subdomain level" then the MX record.






share|improve this answer


























  • I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

    – Thom Smith
    Jan 5 at 15:23
















2














If you can use a subdomain (like www.example.com,) for your website, a CNAME is not a problem and co-exist with an MX record.



The solution I use where I need to resolve example.com (as well as www.example.com) is a minimal server on a known static IP (so I can use an A record) which does a redirect to the www site. This logic is trial for http. While it can work for https it's a bit harder as you need a cert for example.com on the redirect server.



Another possibility which is not as general (,ie AWS specific) is to migrate your domain name to Amazon's Route53 service and use an "alias" record for example.com. An alias record is not a "real" DNS record, but Amazon DNS servers "flatten" an Alias so it is programmed like a CNAME but underneath it converts the record to an A record - which they can do because they control the environment.



Your third option would be to build a dynamic DNS type service that your host updates a DNS A record each time it starts/the IP changes and you run a very low TTL so changes are propogated quickly.



For the sake of clarity, you can point the MX record to a place other then Amazon, you just don't want to use a CNAME at the same or lower "subdomain level" then the MX record.






share|improve this answer


























  • I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

    – Thom Smith
    Jan 5 at 15:23














2












2








2







If you can use a subdomain (like www.example.com,) for your website, a CNAME is not a problem and co-exist with an MX record.



The solution I use where I need to resolve example.com (as well as www.example.com) is a minimal server on a known static IP (so I can use an A record) which does a redirect to the www site. This logic is trial for http. While it can work for https it's a bit harder as you need a cert for example.com on the redirect server.



Another possibility which is not as general (,ie AWS specific) is to migrate your domain name to Amazon's Route53 service and use an "alias" record for example.com. An alias record is not a "real" DNS record, but Amazon DNS servers "flatten" an Alias so it is programmed like a CNAME but underneath it converts the record to an A record - which they can do because they control the environment.



Your third option would be to build a dynamic DNS type service that your host updates a DNS A record each time it starts/the IP changes and you run a very low TTL so changes are propogated quickly.



For the sake of clarity, you can point the MX record to a place other then Amazon, you just don't want to use a CNAME at the same or lower "subdomain level" then the MX record.






share|improve this answer















If you can use a subdomain (like www.example.com,) for your website, a CNAME is not a problem and co-exist with an MX record.



The solution I use where I need to resolve example.com (as well as www.example.com) is a minimal server on a known static IP (so I can use an A record) which does a redirect to the www site. This logic is trial for http. While it can work for https it's a bit harder as you need a cert for example.com on the redirect server.



Another possibility which is not as general (,ie AWS specific) is to migrate your domain name to Amazon's Route53 service and use an "alias" record for example.com. An alias record is not a "real" DNS record, but Amazon DNS servers "flatten" an Alias so it is programmed like a CNAME but underneath it converts the record to an A record - which they can do because they control the environment.



Your third option would be to build a dynamic DNS type service that your host updates a DNS A record each time it starts/the IP changes and you run a very low TTL so changes are propogated quickly.



For the sake of clarity, you can point the MX record to a place other then Amazon, you just don't want to use a CNAME at the same or lower "subdomain level" then the MX record.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 5 at 9:37

























answered Jan 5 at 9:32









davidgodavidgo

43.8k75291




43.8k75291













  • I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

    – Thom Smith
    Jan 5 at 15:23



















  • I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

    – Thom Smith
    Jan 5 at 15:23

















I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

– Thom Smith
Jan 5 at 15:23





I've removed the @ CNAME record. Most browsers should automatically try www. I'll probably try Route 53, but this is a new domain so it can't be transferred yet.

– Thom Smith
Jan 5 at 15:23


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390807%2fset-up-dns-to-forward-mail-to-one-domain-and-other-traffic-to-another%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Paul Cézanne

UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

Angular material date-picker (MatDatepicker) auto completes the date on focus out