Amazon Web服务Route 53忽略域名

问题描述 投票:0回答:1

我在AWS上托管了一组微服务,这些服务通过请求/响应使用在Route 53上定义的DNS名称相互交互,我在其中创建了一个名为api.io的新私有区域,并在我的代码中定义了DNS,例如WSG_KAFKA我已经使用区域名称配置DNS名称,如WSG_KAFKA.api.io有没有办法忽略域名api.io并直接使用DNS名称

amazon-web-services dns amazon-route53
1个回答
1
投票

要直接使用主机名,您需要编辑/etc/resolv.conf并添加search api.io选项,因此您的文件可能如下所示:

search api.io
nameserver 10.0.0.2

这将有助于仅使用WSG_KAFKA搜索您的主机名。

从男子resolv.conf

search Search list for host-name lookup.
          The search list is normally determined from the local domain
          name; by default, it contains only the local domain name.
          This may be changed by listing the desired domain search path
          following the search keyword with spaces or tabs separating
          the names.  Resolver queries having fewer than ndots dots
          (default is 1) in them will be attempted using each component
          of the search path in turn until a match is found.  For
          environments with multiple subdomains please read options
          ndots:n below to avoid man-in-the-middle attacks and
          unnecessary traffic for the root-dns-servers.  Note that this
          process may be slow and will generate a lot of network traffic
          if the servers for the listed domains are not local, and that
          queries will time out if no server is available for one of the
          domains.

          The search list is currently limited to six domains with a
          total of 256 characters.
© www.soinside.com 2019 - 2024. All rights reserved.