LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Networking and hostnames (https://www.linuxquestions.org/questions/linux-networking-3/networking-and-hostnames-499507/)

k3rnel 11-07-2006 02:51 PM

Networking and hostnames
 
I have an issue that has been confusing me for quite some time and I need a little help/guidance. I run a modest home network which consists of the following:

Smoothwall firewall
Linksys 54G WAP
Ubuntu 6.06 server running various services
Ubuntu 6.06 desktop
Windows XP Pro desktop
Ubuntu 6.06 laptop
Windows XP laptop (my wife's machine)
Various other linux and windows machines time to time via virtual machines (vmware)

IP management can sometimes be a nightmare trying to get to particular machines just by hopefully remembering the IP I assigned if static, or worse yet, having to ping my entire subnet to see what is alive and go to the correct one after that. I try to assign static IP's whenever I can, but there has to be an easier solution and I know there is, but I don't know how to implement it.

My end goal would be able to go to a particular machine using it's hostname from anywhere on my network, regardless if the machine had a static or dynamic IP assigned to it. My first thought was bind9, but that is where the confusion comes in as I don't know how it deals with dynamic addresses, or if that is even the best tool for this particular job.

I don't want to deal with having to update /etc/hosts on all my linux boxes or lmhosts on the windows machines, so that is not an option.

In summation, what I am after is that if I plug a machine into my network, regardless of OS, I would like to be able to telnet/ftp/ssh whatever to that machine via it's hostname.

I am so lost! Any help appreciated......

osvaldomarques 11-07-2006 03:51 PM

Hi k3rnel,

As you have one machine defined as server, I would suggest you to set it up to provide dhcp associated with dns.

If this machine is the gateway/firewall for your net, it would be great!

The packages I would suggest you are isc-dhcpd and dnsmasq. The later versions of dnsmasq even supply the dhcpd function but I don't like its configuration file. Depending on the packaging of the dnsmasq, you would need to get the source and recompile it for it read the dhcpd leases file.

In this setup, all your other machines should configure their interfaces using dhcp protocol, fixed or dynamic. The fixed addresses should be configured on the dhcpd.conf and hosts files on the server. You could reserve an address range to machines which you don't need to know their addresses/names.

All your machines, including your server would ask the dnsmasq on your server to resolve all the names, local and public. All the configuration will be defined on the dhcpd.conf. On the server, you need to change the /etc/resolv.conf to point to 127.0.0.1 as the name server. Dnsmasq will read the internet dns servers; then, it will try to resolve any address on the local configuration and, if not resolved, it will try the internet servers of your ISP.

You can decide to use only dnsmasq for both functions. Its configuration file (dnsmasq.conf) is self documented, but it uses the keyword numbers instead of the dhcp protocol keywords.

The beauty of the dnsmasq software is its simplicity when configuring the dns part. I fought with IP numbers until it appeared because I didn't have enough courage to install bind.


All times are GMT -5. The time now is 12:19 PM.