|
Home > Archive > Red Hat Topics > September 2007 > How do I make Fedora 7 propagate its hostname to the network?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How do I make Fedora 7 propagate its hostname to the network?
|
|
|
| I've been using Fedora Core 4 for a home server and to call it from
the local network I can just use its name, so I could ssh
me@fedora_server. I just installed Fedora 7 instead and here I can't
access it by its name (I use its static ip address instead) until I
graphically open up the samba menu. I can /etc/init.d/network restart
and restart samba to no avail but as soon as I go to the samba
configuration and edit anything (I add and then delete a space in
front of the workgroup name), the server is now accessible by the
other networked machines by its hostname. The same router is in place
for both fedora systems and their hardware is the same.
Is there a way I can avoid having to use the GUI menu to enable the
hostname? Has anyone else experienced this problem?
Thanks,
Jo
| |
| Jan Gerrit Kootstra 2007-09-06, 1:14 pm |
| JMecc wrote:
> I've been using Fedora Core 4 for a home server and to call it from
> the local network I can just use its name, so I could ssh
> me@fedora_server. I just installed Fedora 7 instead and here I can't
> access it by its name (I use its static ip address instead) until I
> graphically open up the samba menu. I can /etc/init.d/network restart
> and restart samba to no avail but as soon as I go to the samba
> configuration and edit anything (I add and then delete a space in
> front of the workgroup name), the server is now accessible by the
> other networked machines by its hostname. The same router is in place
> for both fedora systems and their hardware is the same.
>
> Is there a way I can avoid having to use the GUI menu to enable the
> hostname? Has anyone else experienced this problem?
>
> Thanks,
> Jo
>
Jo,
What OS is on the other machines? Linux or Windows?
Kind regards,
Jan Gerrit Kootstra
| |
| JMecc0@gmail.com 2007-09-06, 1:14 pm |
| Windows (some XP some Vista). Even from an ssh terminal though the
name has no meaning until I do the samba config trick.
Jo
| |
| Ivan Marsh 2007-09-06, 1:14 pm |
| On Thu, 06 Sep 2007 10:51:41 -0700, JMecc0 wrote:
> Windows (some XP some Vista). Even from an ssh terminal though the
> name has no meaning until I do the samba config trick.
> Jo
Full name resolution requires the host files to be properly configured,
DNS to be running and WINS (for NetBIOS resolution).
/etc/host is queried first, then DNS and WINS.
If you're not running a DNS or WINS server then you need to look at your
host files.
--
I told you this was going to happen.
| |
| JMecc0@gmail.com 2007-09-06, 7:15 pm |
| I'm not running a DNS/WINS; I'm just using this machine as a network
share + FTP + http + execution of any unix-only programs.
I have no /etc/host (is this the same as /etc/hosts? - this has
192.168.0.170 fedora_server
and my /etc/hostname says fedora_server too, so does echo $HOSTNAME
| |
| Ivan Marsh 2007-09-06, 7:15 pm |
| On Thu, 06 Sep 2007 13:08:15 -0700, JMecc0 wrote:
> I'm not running a DNS/WINS; I'm just using this machine as a network
> share + FTP + http + execution of any unix-only programs.
>
> I have no /etc/host (is this the same as /etc/hosts? - this has
Yea... I meant /etc/hosts
> 192.168.0.170 fedora_server and my /etc/hostname says fedora_server
> too, so does echo $HOSTNAME
No, it does not echo $hostname. The hostname of your machine is only that,
the machine's name. It serves no purpose for network name resolution.
Your /etc/hosts file should at the very least read:
127.0.0.1 localhost.localdomain localhost
<IP address> <hostname>.<domain> <hostname>
Where <IP address> <hostname> and <domain> reflect the IP, hostname and
domain of the machine.
To add an address of remote machine you simply put that machines
information in the hosts file. Ex:
127.0.0.1 localhost.localdomain localhost
192.168.1.1 myserver.mydomain myserver
192.168.1.2 myxpmachine.mydomain myxpmachine
This also needs to be done on every other machine on your network that you
want to be able to address by name. This can be tedious to managed if
you're talking about more than a few machines... at that point it's time
to start running a DNS server.
The hosts file under XP can be found in C:\WINDOWS\system32\drivers\etc. I
have no idea where the host file resides under Vista but I would hope it's
in a similar place.
--
I told you this was going to happen.
| |
| JMecc0@gmail.com 2007-09-06, 7:15 pm |
| I changed the /etc/hosts file to have localhost too, but this didn't
help any. I added the DNS server too but that didn't change
anything.
Does the problem have to do with this:
[root@jfedora7 ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully
qualified domain name, using 192.168.0.170 for ServerName
[ OK ]
What boggles my mind is why the naming came up fine under fedora 4
after doing a /etc/init.d/network restart.
With fedora 4, after starting it up I'd ssh in using the ip address
and do the network restart. After that the server would be ready to
go.
My windows machine's C:\WINDOWS\system32\drivers\etc\hosts contains
nothing regarding any computer on the network (just localhost).
Jo
| |
| General Schvantzkoph 2007-09-06, 7:15 pm |
| On Wed, 05 Sep 2007 23:00:09 -0700, JMecc wrote:
> I've been using Fedora Core 4 for a home server and to call it from the
> local network I can just use its name, so I could ssh me@fedora_server.
> I just installed Fedora 7 instead and here I can't access it by its name
> (I use its static ip address instead) until I graphically open up the
> samba menu. I can /etc/init.d/network restart and restart samba to no
> avail but as soon as I go to the samba configuration and edit anything
> (I add and then delete a space in front of the workgroup name), the
> server is now accessible by the other networked machines by its
> hostname. The same router is in place for both fedora systems and their
> hardware is the same.
>
> Is there a way I can avoid having to use the GUI menu to enable the
> hostname? Has anyone else experienced this problem?
>
> Thanks,
> Jo
SAMBA on F7 requires that you start two daemons, nmb and smb.
| |
| JMecc0@gmail.com 2007-09-07, 1:14 am |
| I was definitely not aware of nmb. It seems to work fine now that
I've added
chkconfig --levels 235 nmb on
If I can startup vncserver on boot, I'll be fully set.
Thanks for the replies!
Jo
| |
| Ivan Marsh 2007-09-07, 1:16 pm |
| On Thu, 06 Sep 2007 14:35:31 -0700, JMecc0 wrote:
> I changed the /etc/hosts file to have localhost too, but this didn't
> help any. I added the DNS server too but that didn't change anything.
That would only identify the machine to itself. You'd have to update the
XP and Vista systems for them to be able to address the Linux machine.
> Does the problem have to do with this: [root@jfedora7 ~]#
> /etc/init.d/httpd restart Stopping httpd:
> [ OK ] Starting httpd: httpd: Could not reliably determine
> the server's fully qualified domain name, using 192.168.0.170 for
> ServerName
No. You need to set your server name in /etc/httpd/conf/httpd.conf for
your web server to know it's own name.
> What boggles my mind is why the naming came up fine under fedora 4 after
> doing a /etc/init.d/network restart. With fedora 4, after starting it up
> I'd ssh in using the ip address and do the network restart. After that
> the server would be ready to go.
Samba might resolve occasionally because of WINS resolution from the
Windows boxes, but for it to be reliable you have to have some kind of
name resolution happening on the network.
> My windows machine's C:\WINDOWS\system32\drivers\etc\hosts contains
> nothing regarding any computer on the network (just localhost).
That's how it is by default. Put the address information for the Linux box
in there and it will resolve.
--
I told you this was going to happen.
| |
| JMecc0@gmail.com 2007-09-07, 7:15 pm |
| Thanks for the info Ivan. I had just assumed my router stored the
names along with each machine's ip and by setting the hostname that
linux could ping the router and tell it its name.
So to keep the list on one machine (say the linux server), I would
have to set up the DNS with all the hosts on my network in a
configuration file and then forward the DNS service from the router to
this machine like I forward the http & ftp port. Is this correct?
Thanks,
Jo
| |
| Ivan Marsh 2007-09-07, 7:15 pm |
| On Fri, 07 Sep 2007 12:50:22 -0700, JMecc0 wrote:
> Thanks for the info Ivan. I had just assumed my router stored the names
> along with each machine's ip and by setting the hostname that linux
> could ping the router and tell it its name.
Your router/switch/hub works on a lower level than name resolution. All
your router can do is associate MAC addresses (interface addresses) with
the IP addresses on its network segment. Name resolution is beyond it's
control.
> So to keep the list on one machine (say the linux server), I would have
> to set up the DNS with all the hosts on my network in a configuration
> file and then forward the DNS service from the router to this machine
> like I forward the http & ftp port. Is this correct?
There's no forwarding involved... the linux box would be providing a
service on your network.
You would configure your linux box to run named (for instance) configure
it to serve your network and to cache a public DNS server, then you would
configure all of the machines on your network to use your linux box as
their primary DNS server.
Your client machines then get local network addresses straight from your
linux box and when you try to resolve a public address the client machine
queries the linux box, the linux box queries a public server and then
answers the client query with information it's now cached.
--
I told you this was going to happen.
|
|
|
|
|