-   Linux - Networking (
-   -   Setting network hostname on CentOS 4.4 (

Pezzoni 04-02-2007 10:50 AM

Setting network hostname on CentOS 4.4
This is probably (and hopefully) a stupid question with a trivial answer, so sorry in advance!

I've just installed CentOS 4.4, and all seems to be OK. What I'm attempting to do is to set the remote hostname of the computer (terminology probably wrong, but I'll attempt to explain).

The 'local' hostname of the computer is fine; when I log in, I see:
[root@webserver ~]#
Which I was expecting. Typing 'hostname' returns 'webserver'.

What I do want to be able to do is to refer to the computer as //webserver from other computers on the network. The other Linux box (running FC5) can be accessed by //linuxserver... Could someone explain where I've gone wrong?

Thanks :)

(As an aside, when I login via SSH, the 'password:' prompt takes a while - about 10-20 seconds - to appear; is this a function of me having cocked the DNS settings up a bit?)

benjithegreat98 04-02-2007 10:59 AM

Would linuxserver be a prexisting DNS entry somewhere? Are you using WINS? If it is WINS there is a program with samba called winbind you may look into.

If linuxserver is a DNS entry somewhere then just add webserver to the dns server

MensaWater 04-02-2007 11:01 AM

//webserver would pull it up if
a) webserver was first resolved as the IP of this host from the host on which you're trying to pull it up in the browser (has to do with the DNS/resolv.conf on that machine rather than anything on webserver itself.
b) You are running something that is listening on the standard httpd port (80) on webserver. ("lsof -i :80" would verify that).
c) You are not blocking outside connections to port 80 in the firewall on webserver, firewall between the boxes or firewall on the server where you ran the browser.

Brian1 04-02-2007 11:01 AM

You want other machines to see the machine as //winserver instead of just a plain IP. For that to work on say the fc5 box you will need to edit /etc/hosts file and add a reference for the IP to hostname.

For ssh log delay can depend on a few things. I assume both machines are on the same network segment? If so then my guess the ssh conection is trying to do passphrases first. Usually a little delay but not much over 5 seconds. I am guessing you are on the right track with the DNS and not resolving correctly which if you are employ this then it can be the issue you have in question one. If you use the IP instead of a hostname does it work faster?


Pezzoni 04-02-2007 11:11 AM

Ahh, linuxserver is running samba, so presumably WINS has something to do with its being resolved? On further investigation, I can't access it by hostname from webserver, whereas I can from my Windows machine with a samba network drive mounted. I'll have to sort samba out on webserver in that case, and then maybe come back to this one.

With that (hopefully) out of the way, does anyone have any ideas about the ssh login problem?

Pezzoni 04-02-2007 11:47 AM

Okay, after configuring samba, I can connect to the server with //webserver, so that issue seems to be resolved!

MensaWater 04-02-2007 02:04 PM

D'oh - got distracted by the webserver name - I thought you were asking how to open an http connection to it rather than a wins connection.

All times are GMT -5. The time now is 06:51 PM.