How to add a * DNS entry to the etc/hosts file in Centos?

ol muser
ol muser used Ask the Experts™
on
How to add a * DNS entry to the etc/hosts file in Centos? This is to allow S3 calls to a cloudian instance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
Commented:
The only entry that can be added to the /etc/hosts file is (an A record)
Ip.  Name
192.168.0.2 myserver myserver.mydomain.com


Once saved access attempt to either myserver or myserver.mydomain.com will translate to 192.168.0.2

Replace the IPA d name to match the destination for IP and the name in the configuration.
ol muserTechnology Generalist

Author

Commented:
Can you please elaborate on the last paragraph please? What's the IPA d name? Which configuration file are we talking about?
Distinguished Expert 2017
Commented:
Autocorrection gone ..


Replace the IP in the example with the IP to which you need the name in the configuration.

Your cloudian instance reference name to the ip to which it should be connected.
David FavorLinux/LXD/WordPress/Hosting Savant
Distinguished Expert 2018
Commented:
You said, "How to add a * DNS entry" + since there's no such thing as * records, provide more clarification by posting exact records you're trying to add to DNS.

Keep in mine, as arnold said above, you can only add A records... so a normal /etc/hosts file entry will look something like...

1.1.1.1 foo.com www.foo.com

Open in new window


This is the only type of entry /etc/hosts supports.

All other DNS records must serve from real DNS server, so CNAMEs + TXT + MX + etc... - must live in a real DNS server.
nociSoftware Engineer
Distinguished Expert 2018
Commented:
The bind DNS server has a method to add a * to a zone, then it will answer all non-matching queries with that record.
So it's a function of the DNS server, not the resolver library. The resolver can query /etc/hosts as alternative to DNS, queries for (A, AAAA, PTR) records.  As such the resolver does not synthesize answers.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial