Reputation: 4306
I have a group of micro-services hosted on AWS, these services interact with each other through request/response using DNS name defined on Route 53 at which i created a new private zone named api.io
and defined the DNSs for example WSG_KAFKA
, in my code i have configure the DNS name with the zone name like WSG_KAFKA.api.io
Is there is any way to ignore the domain name api.io
and use the DNS name directly
Upvotes: 0
Views: 163
Reputation: 26925
To use the hostname directly you need to edit your /etc/resolv.conf
and add search api.io
option, so your file may look like:
search api.io
nameserver 10.0.0.2
That will help to just search your hostname by just using WSG_KAFKA
.
From the man 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.
Upvotes: 1