Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    gethostname() returns unexpected result

    gethostname() returns 'karlmalone.localdomain' I need it to return which is the fqdn. I can fix this by manually doing hostname but it gets reset upon reboot. I believe I have /etc/hosts set properly. Any idea why this occurs?

    /etc/hosts localhost karlmalone

    [ttyson@karlmalone ~]$ hostname
    [ttyson@karlmalone ~]$ hostname --fqdn
    [ttyson@karlmalone ~]$ hostname -d

    gethostname() returns karlmalone.localdomain

    Thanks in advance

  2. #2
    Just Joined!
    Join Date
    Nov 2007
    Camp Pendleton

    You need to setup a search domain in /etc/resolv.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