This is easily achieved with getent
:
getent hosts 127.0.0.1
getent
will do lookups for any type of data configured in nsswitch.conf
.
Related Contents:
- Setting the hostname: FQDN or short name?
- Can I map a hostname *and* a port with /etc/hosts? [closed]
- Why does my hostname appear with the address 127.0.1.1 rather than 127.0.0.1 in /etc/hosts?
- Linux command to inspect TXT records of a domain [closed]
- Force dig to resolve without using cache
- Is it possible to alias a hostname in Linux?
- What’s the reverse DNS command line utility?
- How to determine the hostname from an IP address in a Windows network?
- Hostnames – What are they all about?
- How to disable AAAA lookups?
- Run antivirus software on linux DNS servers. Does it make sense?
- Why does the host command not resolve entries in /etc/hosts?
- How to set the domain name on GNU/Linux?
- Difference between /etc/hosts and /etc/resolv.conf
- sed replace all tabs and spaces with a single space
- How do I rename a Linux host without needing to reboot for the rename to take effect?
- A domain I’ve never heard of resolves to my website [duplicate]
- How to enforce dnsmasq to use an upstream dns server only for some specified domain names?
- hosts file seems to be ignored
- How to simulate DNS server response timeout?
- Iptables: “-p udp –state ESTABLISHED”
- My DNS server is pushing 20mbps, why?
- How to set multiple subdomains in the host file (DNS)?
- Adjusting how long Linux takes to fail over to backup DNS server listed in resolv.conf
- Resolv Conf Multiple DNS Servers with specific domains
- On Ubuntu 10.04, should /etc/hostname contain the server’s FQDN?
- Find out the DNS server for a DHCP connection in Linux
- How to setup a simple DNS server to answer just for one name and forward all the rest?
- Difference between DHCP options ‘Domain-Name’ and ‘Domain-Search’
- How do I register Linux server with Windows DNS server
- Listing all zones loaded in BIND
- WGET can’t resolve host
- Can’t connect to MySQL using ‘localhost’ but using ‘127.0.0.1’ it’s ok?
- Can a different DNS server be used for subdomains?
- Register A records for my Linux box on my Windows 2008 DNS/DHCP server
- Checklist for changing the hostname of a server [closed]
- How does my DHCP server know my machine’s hostname when I didn’t define one in dhclient.conf?
- If I shut down Amazon EC2 instance then start it again, will everything be ok?
- SSH client name resolution fails for names that are resolvable
- Correct way to set up DNS primary/secondary/… for redundancy and latency reduction?
- bind9 proper recursion setup
- Allow OpenVPN client to push it’s own DNS servers, regardless of OpenVPN server’s pushed dns?
- Amplified reflected attack on DNS servers
- How to get hostname from IP (Linux)?
- How do I rename all folders and files to lowercase on Linux?
- Find files and tar them (with spaces)
- How to get child process from parent process
- mount: unknown filesystem type ‘linux_raid_member’
- Find out which process is changing a file
- How can I do traffic shaping in Linux by IP?