Results 1 to 9 of 9
Hi One and all,
I am using redhat version 2.618-8.el5 gcc version 4.1.1.20070105. I am planning to set my domain name as (eg:example.com) as permanently in redhat.
Steps i have ...
- 07-17-2011 #1Just Joined!
- Join Date
- Jul 2011
- Location
- Chennai, Tamilnadu
- Posts
- 13
How to set Domain name
Hi One and all,
I am using redhat version 2.618-8.el5 gcc version 4.1.1.20070105. I am planning to set my domain name as (eg:example.com) as permanently in redhat.
Steps i have tried:
1: set under etc/sysconfig/network --Domain name=example.com
unfortunately when i tried to view my domainname in terminal it says NONE.
I even tired configuring under /etc/resolv.con file even that didn't work.
Please advise me how to set my domainname.
- 07-17-2011 #2Just Joined!
- Join Date
- Dec 2009
- Posts
- 1
you can set it in /etc/sysconfig/network by adding the FQDM under the HOSTNAME variable
ex. HOSTNAME=host.example.com
- 07-17-2011 #3Just Joined!
- Join Date
- Jul 2011
- Location
- Chennai, Tamilnadu
- Posts
- 13
Hi Wilrab,
Thanks for replying me back, I did the same but my machine could understand fully qualified domain name when i use hostname -s it says NONE rather giving me the host name alone. Actually i am trying to configure samba PDA, the client machine couldn't fetches the domainname as i set in the sysconfig file. which mean server machine didn't know the domainname i'm correct in my understanding. Please advise if i am wrong any where? MY client machine is Windows 7.
- 07-18-2011 #4
can you post the contents of /etc/sysconfig/network?
- 07-19-2011 #5Just Joined!
- Join Date
- Jul 2011
- Location
- Chennai, Tamilnadu
- Posts
- 13
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=station10.example.com
- 07-20-2011 #6
Now please post the output from the following commands:
hostname
hostname -s
- 07-21-2011 #7Just Joined!
- Join Date
- Jul 2011
- Location
- Chennai, Tamilnadu
- Posts
- 13
Hey Roberts, Thanks for all your valuable assistance i figured out the problem
- 07-23-2011 #8
Great news. Now it would only be polite to post how you fixed it for the next person who comes across the same issue.
- 07-23-2011 #9Just Joined!
- Join Date
- Jun 2011
- Posts
- 30
Maybe this 'Copy/Paste' from '$> man hostname' is helpfull:
...
hostname will print the name of the system as returned by the gethostname(2) function.
...
The function gethostname(2) is used to get the hostname. When the hostname -a, -d, -f or -i is called will gethostbyname(3) be called. The difference in gethostname(2) and gethostbyname(3) is that gethostbyname(3) is network aware, so it consults /etc/nsswitch.conf and /etc/host.conf to decide whether to read information in /etc/sysconfig/network or /etc/hosts.
...
Conclusion: always have the FQDN in /etc/hosts and in /etc/sysconfig/network. Or try (and error) with /etc/host.conf and nsswitch.conf (see also '$> man host.conf' and/or '$> man nsswitch.conf' ).


Reply With Quote