将 Google 域链接到 Amazon ec2 服务器 [英] link a Google Domain to Amazon ec2 server

查看:26
本文介绍了将 Google 域链接到 Amazon ec2 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Amazon EC2 实例为 node.js 应用程序提供服务.我最近通过 ) 打开 DNS 设置

  • 填写页面底部附近标题为自定义资源记录"的表单
    • 名称:在这种情况下,我们要使用@"或www"
      • @ 是根记录(或任何未特别设置的内容)[all]
      • www 是人们输入 www.example.com
      • 的记录
    • 类型:有两种类型;A 表示 IPv4 地址,AAAA 表示 IPv6 地址
      • 两者都可以分别设置,一般要使用A [IPv4]
    • TTL:生存时间,建议离开1hr(这是一个高级属性)
    • 数据:您要指向的实际 IP 地址(您的网站)
      • 示例:8.8.8.8 [Google 域名服务器]
  • 现在已经填写了空格,请按添加"按钮
  • 等待记录公开更新
    • 这将需要大约.1 小时(只要您将 TTL 保持在 1hr)
      • 此步骤可能需要更长时间,具体取决于 Google 的服务器
    • 检查您的网站 www.example.com 以确认它已更新
  • I am using an Amazon EC2 instance to serve a node.js app. I recently purchased a domain name through Google Domains and I want to use that domain name to access my node.js app.

    The Google Domains console allows you to forward your domain traffic to another website. I set it to forward traffic to the public IP address of my EC2 instance. I can access my app just fine now, but when I type www.myDomainName.com into a web browser, the URL bar immediately changes and displays the digits of my EC2 IP address.

    I would like the URL bar to display the name of my domain instead.

    Note:
    I have read a few SO questions related to this and can't figure it out. Some of them are a bit over my head. Many of them say to use an Amazon Elastic IP, but I don't understand why this is necessary if the public IP of my EC2 instance seems to work just fine. If the solution here is to use Amazon Elastic IP, I would really appreciate an explanation as to why that is necessary,

    解决方案

    It sounds like you are using Google Domains to redirect to another site once the request has hit the Google servers. This is fine and dandy if you have another domain you are wanting to redirect to.

    If you want it to stay under your domain name, but point to another location you need to actually change the DNS entries for your domain.

    Go to Google Domain services and change your master(*) (A) record, as well as your WWW (A) record, to point at your public IP address. That way when a DNS request is sent for your domain it will just ask Amazons' servers what to do instead of using a redirect from Google.

    Exact Steps:

    1. From the Google Domain Website, click the Middle Tab () to open DNS settings
    2. Fill out the form near the bottom of the page titled, Custom Resource Record
      • Name: In this scenario we want to use "@" or "www"
        • @ is the root record (or anything not specifically set)[all]
        • www is the record for when people type www.example.com
      • Type: There are two types; A refers to IPv4 address and AAAA refers to IPv6 address
        • You can set both of them separately, generally you want to use the A [IPv4]
      • TTL: Time to live, recommend leaving 1hr (this is an advanced attribute)
      • Data: The actual IP address you are wanting to point to (your website)
        • Example: 8.8.8.8 [Google Nameserver]
    3. Now that are the blanks are filled out, press the "Add" button
    4. Wait for the records to be updated publicly
      • This will take approx. 1hr (as long as you kept TTL at 1hr)
        • This step can take longer depends on Google's servers
      • Check your website www.example.com to confirm it has updated

    这篇关于将 Google 域链接到 Amazon ec2 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆