hosts(5) File Formats Manual hosts(5)Name
hosts - host name file
Description
The file is an ASCII file that contains information about the known hosts on the DARPA Internet. For each host a single line should be
present with the following information:
Internet address
Official host name
Aliases
Each name is separated from the next by a new line. Items are separated by any number of blanks or tab characters. A number sign (#)
indicates the beginning of a comment; characters up to the end of the line are not interpreted by routines that search the file. This file
is normally created from the official host data base maintained at the Network Information Control Center (NIC), though local changes may
be required to bring it up to date regarding unofficial aliases or unknown hosts.
Host addresses are specified in the conventional dot (.) notation using the inet_addr routine from the Internet address manipulation
library, Host names can contain any printable character other than a field delimiter, newline, or comment character.
The database may be distributed in a network by a naming service, such as Yellow Pages or BIND/Hesiod. See the Guide to the Yellow Pages
Service or the Guide to the BIND/Hesiod Service for setup information.
FilesSee Alsogethostent(3n)
Guide to the BIND/Hesiod Service
Guide to the Yellow Pages Service
hosts(5)
Check Out this Related Man Page
HOSTS(5) BSD File Formats Manual HOSTS(5)NAME
hosts -- host name data base
DESCRIPTION
The hosts file contains information regarding the known hosts on the network. It can be used in conjunction with the DNS, and the NIS maps
'hosts.byaddr', and 'hosts.byname', as controlled by nsswitch.conf(5).
For each host a single line should be present with the following information:
address hostname [alias ...]
These are:
address Internet address
hostname Official host name
alias Alias host name
Items are separated by any number of blanks and/or tab characters. A hash sign (``#'') indicates the beginning of a comment; characters up
to the end of the line are not interpreted by routines which search the file.
When using the name server named(8), or ypserv(8), this file provides a backup when the name server is not running. For the name server, it
is suggested that only a few addresses be included in this file. These include address for the local interfaces that ifconfig(8) needs at
boot time and a few machines on the local network.
This file may be created from the official host data base maintained at the Network Information Control Center (NIC), though local changes
may be required to bring it up to date regarding unofficial aliases and/or unknown hosts. As the data base maintained at NIC is incomplete,
use of the name server is recommended for sites on the DARPA Internet.
As network addresses, both IPv4 and IPv6 addresses are allowed. IPv4 addresses are specified in the conventional dot (``.'') notation using
the inet_pton(3) routine from the Internet address manipulation library, inet(3). IPv6 addresses are specified in the standard hex-and-colon
notation. Host names may contain any printable character other than a field delimiter, newline, or comment character.
FILES
/etc/hosts The hosts file resides in /etc.
SEE ALSO gethostbyname(3), nsswitch.conf(5), ifconfig(8), named(8)
Name Server Operations Guide for BIND.
HISTORY
The hosts file format appeared in 4.2BSD.
BSD November 17, 2000 BSD
I need to use the RSH command to run a shell script on my Unix box from Win 2000. I'm using the etc/hosts.equiv file for configuring Unix. In it I have the hostname and username as required. As a test, I enter the following on the Win 2000 dos command: rsh servername -l username df -k.
The... (8 Replies)
Hello again!
When I log in to my computer (Ultra 5 running Solaris 8) from a pc (FTP or Telnet) I have to wait forever (about 30 seconds) before I can log in. Is this some kind of security thing? Can I turn it of? How?
Anders (8 Replies)
Hi,
I want to change the /etc/hosts file on the hmc. I am connecting via ssh but any vi command is not allowed.
Can someone please let me know how to do this?
Many Thanks.
Kees (23 Replies)
I am running Solaris 2.6 Server on a Sparc 10 and I was wondering how I can manually specify a DNS server to resolve hostnames. Any help will be greatly appreciated.
And also I have created a file in the /etc dir named defaultrouter and added th IP address of my router, but when I ping another... (15 Replies)
Hello everyone.
Im using last redhat enterprise edition and in my working environment, i'm always reconfiguring both interfaces , eth0 and eth1, everytime i change any interface, (i use ifconfig to change ip, and after i execute "/etc/init.d/network restart") my "/etc/hosts" file... (9 Replies)
By a shell script When I am logging into hosts one by one with ssh.
I am getting below message.
Pseudo-terminal will not be allocated because stdin is not a terminal.
stty: : Invalid argument
stty: : Invalid argument
Can you please suggest what should I do to stop this?
... (10 Replies)
I wonder whether someone can help me with what I'm trying to achieve
Basically, the objective is one script to create new user on more than 70 linux hosts if required.
Everything works apart from the highlighted part. It gave me an output
passwd: Unknown user name ''. when try to set... (35 Replies)
Hi guys - I am having a hard time trying to figure how to search for a certain string on config files hosted on multiple hosts.
This is an example:
Hostnames: myhost1.mycompany.com|myhost2.mycompany.com|myhost3.mycompany.com
String to search for: myipaddress.somehost.com
Directory... (9 Replies)
ello,
i am new to the networking side.
I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination.
please help me where i am going wrong.
my code:
#!/bin/bash
#read the file line by line
cd "$1"
cat... (17 Replies)
Hi everyone!
Some time ago, I had to check connectivity with a big list of hosts, using different formats (protocol://server:port/path/, server:port, ....).
I developed a script that checks the connectivity using different commands (ping, telnet, nc, curl).
It worked for me so I'm sharing it... (9 Replies)
Dear Folks,
I am trying to read a config file contains ip and port numbers.
i want to read each line of the config file and check ssh connection is happening or not.
Kindly guide.
Config file:
abc@1.2.342 22
abc@1.2.343 22
abc@1.2.344 22
abc@1.2.345 22... (9 Replies)
Hello
I use a bash script to creating the hosts file /etc/hosts
But there is a bug inside my output and I want to fix this.
My Array looks like this:
205,IP 111.122.133.20
205,HOST2 unas
205,HOST1 unas15533
205,COMMENT # UNAS
775,IP ... (9 Replies)