Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have read over quite a few articles and post about hostnames. I have two boxes, both running Fedora Core 4, and one Windows box, all of which are connected through my netgear router. I want to be able to ssh to my apache box to have access to files using my computers name rather than the IP address. My router is set up for DHCP but it doesn't seem to change IP address and I have tried setting up the hostname using hostname mybox.mynetwork on both computers and have also edited both /etc/hosts to read:
192.168.0.3 mybox.mynetwork mybox
in the first linux box (non apache)
192.168.0.4 mybox2.mynetwork mybox2
in the second linux box (apache).
I am getting confused with DHCP servers and FQDN, do I need to have a real domain name to get this to work? Sorry if the answer is staring me in the face but I am really stressing over this now, I kknow it should be simple, but it aint!
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
I would use the same hosts file on all machines even if the machine is listed.
192.168.0.3 mybox.mynetwork.com mybox
192.168.0.4 mybox2.mynetwork.com mybox2
/etc/host.conf should look like this to check hostnames first.
order hosts,bind
Also you should setup the ethernet as static and not as dhcp so they will always have the same IP on boot.
Example of /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST='tion: --broadcast'
# HWADDR=00:90:32:0D:2F:58
IPADDR=192.168.231.58
NETMASK=255.255.255.0
NETWORK='option: --network'
ONBOOT=no
TYPE=Ethernet
GATEWAY=192.168.231.1
Thanks for all the help. I can't check out what you said until I finish work but I think the problem was I was only putting the IP address of the host computer in the etc/hosts file, I never thought about putting both IP addresses on, I must have thought that it would mess up with that individual computers IP or something. I'll post back later on to let you know how it goes. And thanks Brian1, I will be sure to disable DHCP.
This is honestly the first chance I've had to post back (2 jobs...getting to old for this :P). Ok, I changed the hosts file on both computers to allow access using the hostnames.
Files looked like this
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.0.3 ozone.alpha ozone
192.168.0.4 joker.alpha joker
This has allowed me to connect to my machine as I wanted, so thanks very much guys! Again, sorry I couldn't post back sooner. I also setup my router to give me a static IP address, thanks Brian.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.