We help IT Professionals succeed at work.

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

ol muser
ol muser asked
How to add a * DNS entry to the etc/hosts file in Centos? This is to allow S3 calls to a cloudian instance.
Watch Question

Distinguished Expert 2019
The only entry that can be added to the /etc/hosts file is (an A record)
Ip.  Name myserver myserver.mydomain.com

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

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


Can you please elaborate on the last paragraph please? What's the IPA d name? Which configuration file are we talking about?
Distinguished Expert 2019
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 FavorFractional CTO
Distinguished Expert 2019
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... 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 2019
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.