DHCP Register Multiple Hostnames/Subhostnames with Router
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.
Your question needs some clarification. What do you mean by 'have a computer register multiple hostnames'? Normally, when using DHCP, a client computer acquires its hostname from the DHCP server. I don't know of any way that a computer can have more than one hostname.
Same deal with what you mean by 'registering a computer through DHCP'. A client host simply acquires IP and other information from a DHCP server host. The only 'registration' performed is the possible entry of a lease in a table maintained by the DHCP server, for the purpose of consistent & persistent use of the IP for a particular host. No other host or service makes use of that lease record.
It is possible to have multiple DNS entries for a single IP. That is not related to DHCP.
I think there is some system or convention that uses the DHCP config file as a single point of entry for DNS configuration. I wouldn't mind finding some more details on that for my own purposes, and if I do find something, I'll post it back here. However, I still see a possible problem with the use of multiple hostnames in a DHCP config file (assuming ISC DHCP, or compatible), and that seems like the most likely roadblock to me.
The DHCP server configuration has entries that are like
Code:
option host-name yourhostname;
I don't think it is permitted to use multiple hostnames or multiple entries. The hostname is basically an alias for 'localhost', and isn't seen outside of the local host. There are scripts that use hostname and the hostname file, and I assume that these expect exactly one name to be supplied. I would anticipate that adding additional names would probably cause these to break.
DNS entries are separate from hostnames. You can have multiple DNS entries pointing to one IP and this is conceptually separate from the local hostname. I do not know the mechanics of starting/stopping/modifying the DNS server.
On all Linux hosts that I've used (using ISC DHCP) there is a system of hooks that launch scripts triggered by various DHCP client events. You can potentially use and modify these to serve your own special purposes. I have done so, and found it not too complex. See the man pages 'dhclient' and 'dhclient-script' for details.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.