Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Location
    Chennai, Tamilnadu
    Posts
    13

    Cool 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.

  2. #2
    Just 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

  3. #3
    Just 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.

  4. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    can you post the contents of /etc/sysconfig/network?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  5. #5
    Just Joined!
    Join Date
    Jul 2011
    Location
    Chennai, Tamilnadu
    Posts
    13
    NETWORKING=yes
    NETWORKING_IPV6=yes
    HOSTNAME=station10.example.com

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Now please post the output from the following commands:

    hostname
    hostname -s

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  7. #7
    Just Joined!
    Join Date
    Jul 2011
    Location
    Chennai, Tamilnadu
    Posts
    13
    Hey Roberts, Thanks for all your valuable assistance i figured out the problem

  8. #8
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Great news. Now it would only be polite to post how you fixed it for the next person who comes across the same issue.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  9. #9
    Just Joined!
    Join Date
    Jun 2011
    Location
    Belgium
    Posts
    84
    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' ).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •