julyclyde

EC2 里的主机名是不是应该可以内部解析的?

  •  
  •   julyclyde ·
    julyclyde · Oct 5, 2016 · 4589 views
    This topic created in 3685 days ago, the information mentioned may be changed or developed.
    昨天去申请了俩机器, console 里显示
    Private DNS
    ip-172-30-1-133.ap-northeast-1.compute.internal

    但我发现这个域名没法解析; dig -x IP 地址也发现没有 PTR 记录
    这是什么原因呢?

    我记得古代用的时候是可以解析的啊,是我这次选错什么了吗?
    16 replies  •  2016-11-14 20:18:21 +08:00
    skydiver
    skydiver
    Oct 5, 2016 via iPad
    1
    ip 都写出来了为什么要域名
    sutra
    sutra
    Oct 5, 2016
    2
    写到 /etc/hosts 里不就好了么?
    popu111
    popu111
    Oct 5, 2016
    3
    你需要看 public DNS ,这个是内网互联用的
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    4
    @skydiver 有些程序会去尝试重新解析本机的主机名
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    5
    @sutra 那多麻烦啊,好多机器呢,生成之后才知道 IP ,都去手工改还不累死了
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    6
    @popu111 我说的就是内网互联用的那个,在内网 DNS 解析不了的情况
    geralt0725
    geralt0725
    Oct 5, 2016
    7
    两台机器内网地址走得通的前提是在一个区
    内网地址是让你从一台跳板机跳到其他机器用的
    因为公网地址是会被盖掉的,比如开 VPN
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    8
    @geralt0725 IP 是通的。我问的是域名
    geralt0725
    geralt0725
    Oct 5, 2016
    9
    @julyclyde 用弹性 IP 吧 为什么要用私有 IP 呢
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    10
    @geralt0725 我内网通信啊
    你如果知道能不能,怎么办的话就请告诉我。不要质疑动机
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    11
    文档:
    http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html
    段落:
    we provide the instance with a public DNS hostname only if DNS hostnames are enabled for the VPC. By default, DNS hostnames are enabled only for default VPCs and VPCs that you create using the VPC wizard in the VPC console.

    而我的 VPC 是在创建 EC2 instances 的时候“顺手”创建的,所以默认没开启
    enableDnsHostnames
    Indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not. If you want your instances to get DNS hostnames, you must also set the enableDnsSupport attribute to true.

    去 VPC 的控制面板,右键点那个 VPC ,然后菜单里选 Edit DNS hostnames ,在小窗口里开启该功能即可
    不过 PTR 记录是依然没有的
    julyclyde
    julyclyde
    OP
    Oct 5, 2016
    12
    古代我玩的时候应该还没有 VPC 这个服务呢
    看来必须时刻追新啊,要不然知识就跟不上发展了
    xderam
    xderam
    Oct 20, 2016
    13
    @julyclyde 你太老了, 12 年就有 vpc 啦。: p
    julyclyde
    julyclyde
    OP
    Oct 20, 2016
    14
    @xderam 我前几天看了看自己的 ssh key 还是 2009 年的,唉
    snnn
    snnn
    Oct 25, 2016
    15
    @julyclyde 这东西要经常换啊!
    julyclyde
    julyclyde
    OP
    Nov 14, 2016
    16
    @snnn 是啊!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1733 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 14:37 · PVG 22:37 · LAX 06:37 · JFK 09:37
    ♥ Do have faith in what you're doing.