Results 1 to 7 of 7

Thread: Hosts

  1. #1
    Join Date
    Jun 2008
    Location
    Dublin, Ireland
    Posts
    298

    Default Hosts

    Hi,

    If I put the following in my hosts file in /etc/hosts

    192.168.0.80 Website Hosting - Mysite.com

    and then type that into my browser, will it know that this site is hosted locally, and not try and go to the internet for the address. I have Apache running and configured on my machine.

  2. #2
    Join Date
    Mar 2008
    Location
    Bochum, Germany
    Posts
    3,587

    Default Re: Hosts

    * eeijlar,

    syntax is

    192.168.0.80 www.mysite.com

    but else yes, that'll do the trick.

    Uwe

  3. #3
    rixonmb NNTP User

    Thumbs down Re: Hosts

    Hi,
    I am also having somewhat similar problem.I am trying to change the host name of a Suse 10.1 linux machine.
    I have modified /etc/hosts as follows :


    127.0.0.1 localhost.localdomain localhost
    ##< IP ADDRESS> <OLD HOSTNAME>
    <IP ADDRESS> <NEW HOSTNAME>


    /etc/nsswitch.conf is modified as follows :
    #hosts: db files nisplus nis dns
    ##hosts: files nisplus dns
    hosts: files


    echo example.com > /etc/hostname
    /bin/hostname -F /etc/hostname

    I get this error message

    'hostname: can't open `/etc/hostname'

    After executing these steps, my machine is not taking the new
    hostname.
    If I execute
    #hostname


    I get hostname as (none)



    what is that which I am missing here.
    Thanks in Advance!

  4. #4
    ab@novell.com NNTP User

    Default Re: Hosts

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Yikes.... this isn't the right place to set that value. Yast: Network
    Devices: Network Card: Traditional (or whatever). In here there is some
    option for setting your DNS server as well as your host name. Set it
    here and then Finish in Yast and it will be set from then on (may need
    to reboot to get all your TTYs updated).

    Good luck.






    rixonmb wrote:
    | Hi,
    | I am also having somewhat similar problem.I am trying to change the
    | host name of a Suse 10.1 linux machine.
    | I have modified /etc/hosts as follows :
    |
    |
    | 127.0.0.1 localhost.localdomain localhost
    | ##< IP ADDRESS> <OLD HOSTNAME>
    | <IP ADDRESS> <NEW HOSTNAME>
    |
    |
    | /etc/nsswitch.conf is modified as follows :
    | #hosts: db files nisplus nis dns
    | ##hosts: files nisplus dns
    | hosts: files
    |
    |
    | echo example.com > /etc/hostname
    | /bin/hostname -F /etc/hostname
    |
    | I get this error message
    |
    | 'hostname: can't open `/etc/hostname'
    |
    | After executing these steps, my machine is not taking the new
    | hostname.
    | If I execute
    | #hostname
    |
    |
    | I get hostname as (none)
    |
    |
    |
    | what is that which I am missing here.
    | Thanks in Advance!
    |
    |
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIfLQ63s42bA80+9kRAo2IAJ9s1NSXtCKyC9hDi1ebuVn5vJzncwCcD9O9
    IeaOiwi/1RQL5rydHPOovtc=
    =j2of
    -----END PGP SIGNATURE-----

  5. #5
    rixonmb NNTP User

    Default Re: Hosts

    Dear ab@novel.com

    We did set through Yast; Network Services; for Hostname and DNS server and everytime we did this we had to restart the server for the settings to take effect. However, the hostname is alwaya set to <none> on the restart.

    And even when we try to force IT TO PICK THE RIGHT HOSTNAME, hostname services by >>hostname -F /etc/hostname; an error occurs as explained in my earlier e-mail.

    In addition, hostname aliase changes everytime we run Hostname and DNS services through YAST. We seem to be going round in cycles! Please assist.

    Regards;
    SARA

  6. #6
    ab@novell.com NNTP User

    Default Re: Hosts

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Do you have the checkbox checked to set hostname via DHCP? This
    checkbox is right below the host field in Yast as I recall.

    Good luck.






    rixonmb wrote:
    | Dear ab@novel.com
    |
    | We did set through Yast; Network Services; for Hostname and DNS server
    | and everytime we did this we had to restart the server for the settings
    | to take effect. However, the hostname is alwaya set to <none> on the
    | restart.
    |
    | And even when we try to force IT TO PICK THE RIGHT HOSTNAME, hostname
    | services by >>hostname -F /etc/hostname; an error occurs as explained
    | in my earlier e-mail.
    |
    | In addition, hostname aliase changes everytime we run Hostname and DNS
    | services through YAST. We seem to be going round in cycles! Please
    | assist.
    |
    | Regards;
    | SARA
    |
    |
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIfMFX3s42bA80+9kRAoiHAJ9CoYwb+mK5MgLOmHWcAsLsP1HZcQCbBoCy
    cIEdwiclTwKtxkMstQXj3H4=
    =AU4T
    -----END PGP SIGNATURE-----

  7. #7
    rixonmb NNTP User

    Default Re: Hosts

    The check box is not selected and is greyed out (checkbox checked to set hostname via DHCP).

    Currently we are logged-in and the moment we log out, the settings will be lost or the hostname becomes <none>. This just weird, we had to use pppd call isp command to connect and then to allow other services run like squid, fetchmail, postfix. However, the hostname when call does not have the dnsdomainname; i.e. when i run the command : hostname, I get; sararail instead of sararail.org which is my full hostname.

    Your assistance is called for!

    Regards;
    SARA

Posting Permissions

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