Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-23-2003, 01:28 AM
|
#1
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
Sending hostname along with DHCP request
Hi there.
I have several computers networked together with one being the gateway/DHCP server. It all works just fine except for one thing. I was wondering if it was at all possible to send a computer's host name along with the DHCP request.
To explain further... Let's say I have a computer (IP 192.168.0.1) acting as a gateway and three other computers (DHCP assigned addresses) networked to it through a hub. Let's say the gateway's hostname is "gateway" and the other three computers are called "comp1", "comp2" and "comp3". As it stands, to telnet to any of the other three computers, I have to type telnet <IP address>. Is it at all possible to dynamically assign host names as well? In other words, I'd like to be able to type telnet comp1, for example. This is easy with static IPs but these are dynamic. So i'd either like each computer to send it's unique hostname to the DHCP server (and hence to the rest of the network) or each computer to request a specific IP from the DHCP server (and then I could edit /etc/hosts as usual confident in the knowledge that the IP will be the same each time).
Any suggestions?
Last edited by adz; 10-23-2003 at 01:29 AM.
|
|
|
10-23-2003, 01:37 AM
|
#2
|
Senior Member
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127
Rep:
|
bind the hostname to the IP addresses you are leasing to your clients. And you can pick which machine get's the IP via the MAC addresses of their NICs.
this is a combination of DCHP and DNS service setup.
something like (in dhcpd.conf):
host client1 {
next-server client1.domain.org;
hardware ethernet 12:xx:xx:xx:xx:xx;
fixed-address 192.168.0.1;
}
(in your dns zone file):
client1 IN A 192.168.0.1
hth.
Last edited by born4linux; 10-23-2003 at 01:48 AM.
|
|
|
10-23-2003, 01:50 AM
|
#3
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Original Poster
Rep:
|
How do I do that? I presume I have to edit the dhcp.conf file but what options do I put in it?
|
|
|
10-23-2003, 08:12 AM
|
#4
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
You can assign hostnames via DHCP, but the name lookups are done via DNS. comp1 doesn't know that comp2 points to IP2 without a DNS lookup. To get around this, you can run your own local DNS server or create hosts files on each machine.
|
|
|
10-23-2003, 10:15 AM
|
#5
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Original Poster
Rep:
|
Yeah I was hoping to avoid the hosts files. There's no guarantee that comp1 will get the same IP assigned to it each time. It generally does, I have to say, but it's not a robust system. I want something bulletproof. Or at least fairly reliable. Could you give me a few pointers on setting up a DNS server? Or at least point me to a good HOWTO? Oh and how exactly do I assign host names via DHCP?
|
|
|
All times are GMT -5. The time now is 10:23 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|