Results 1 to 4 of 4
Hi ,
I have not configured DNS in rhel 5.5.in /etc/hosts i have to rename my hostname.Say my hostname is System how do i enter that? please provide syntax. in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-14-2013 #1Just Joined!
- Join Date
- Jan 2013
- Posts
- 1
rhel 5.5 /etc/hosts file
Hi ,
I have not configured DNS in rhel 5.5.in /etc/hosts i have to rename my hostname.Say my hostname is System how do i enter that? please provide syntax. in addition to that /etc/hosts contains :1 a new line what is that really?
- 01-14-2013 #2
Hi and welcome
The hostname and its dns resolution are related, but still different things.
Look at /etc/sysconfig/network to define a HOSTNAME
https://access.redhat.com/knowledge/...config-network
The /etc/hosts file is just a static mapping file between IPs and hostnames, mostly if a real DNS is not available or undesired and/or for localhost lookups.
::1 is the shortened ipv6 interface-local scope IP address.
More or less the same as 127.0.0.1 for ipv4.You must always face the curtain with a bow.
- 01-14-2013 #3Linux Enthusiast
- Join Date
- Apr 2012
- Location
- Virginia, USA
- Posts
- 561
Best / most correct way from command line is run the command
system-config-network
as root.
Then in DNS settings you can set your hostname.
- 01-15-2013 #4Linux Newbie
- Join Date
- Nov 2009
- Posts
- 117
vivekredhat.
I'm unclear as to what exactly you are trying to do here. First, the hostname of the box is usually taken from /etc/HOSTNAME (SuSE) or similar or is given by the DHCP server.
If you are playing around with /etc/hosts, I assume you are using a fixed IP address for the box in which case the entry in /etc/hosts is IP Address whitespace host name. If you want more than one host name to be resolve to that IP address, enter them all on the same line separated by whitespace.
Finally, make sure that your /etc/nsswitch.conf contains appropriate entries.


Reply With Quote
