SPB
SPB

Reputation: 4218

Map IP to hostname in linux

Is there any file in linux where IP can be mapped to hostname.Please tell me the path

As we have in windows: By changing in host file we can map a static ip to a host name.

Upvotes: 4

Views: 20834

Answers (1)

Joel
Joel

Reputation: 30166

Do you mean the /etc/hosts file?

/etc/hosts

Typical entries might look like:

127.0.0.1   localhost
127.0.0.1 sagan
192.168.1.87 bohr

Upvotes: 18

Related Questions