Find the answer to your Linux question:
Results 1 to 3 of 3
freebsd 6.0 i try to set new hostname using: Code: sysctl kern.hostname=newhost.com it works, but now when i try xterm it says: Code: $ xterm Xlib: connection to ":0.0" refused ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    17

    sysctl hostname


    freebsd 6.0

    i try to set new hostname using:

    Code:
    sysctl kern.hostname=newhost.com
    it works, but now when i try xterm it says:

    Code:
    $ xterm
    Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified
    xterm Xt error: Can't open display: :0.0
    so i change hostname back and xterm works again. can i change hostname without restart?

  2. #2
    Just Joined! stukov's Avatar
    Join Date
    Feb 2007
    Posts
    44
    You could try setting your hostname with the "hostname" command. I have absolutely no clue if it will work...

    Let me know if it did.

    EDIT: You can also set your hostname in /etc/rc.conf so that when you reboot it will be already set.

  3. #3
    Just Joined!
    Join Date
    Jan 2007
    Posts
    11
    for changing the hostname without restart the system.

    sysctl kernel.hostname=newhost.com

    also make the entry in /etc/sysctl for permanent.

    kernel.hostname=newhost.com

  4. $spacer_open
    $spacer_close

Posting Permissions

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