Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Distribution: Linux Mint 14 (Cinnamon), Xubuntu 12.04, Ubuntu 10.04
Posts: 49
Rep:
Multiple hostname for the same interface
Hi all,
I have a VM with apache on it serving three different sub-domains, for example:
user.example.com
moderator.example.com
admin.example.com
When the VM starts, it gets its IP from the DHCP which should update the nameserver (both are on another VM in the same internal network)
Is there a way for me to register all three hostnames (user, moderator, admin) through DHCP so that anyone in the example.com domain can access any of the addresses, even if the VMs IP had changed?
I tried looking in the following directions, but couldn't find the answer
Change the dhclient to publish several hostnames
Change the way the DHCP and the NS talk, so that the DHCP would know how to magically notify the NS on that
Change the way the NS works
The current solution I followed was to assign a static IP for that VM, with static entries in the NS, but I'm looking for something funkier
a web server has no business running on DHCP. That's just horrible.
What I would suggest is seeing a difference between a hostname and a web domain it serves. A machine should be called by, and therefore registered to DHCP as, the name of the BOX, not of it's websites. the ONLY A record for that box should be the machine hostname. any subsequent sites that it hosts should then be defined statically in DNS as CNAME records pointing to that A record.
a web server has no business running on DHCP. That's just horrible.
I can see where it would be useful to use DHCP to configure things like default gateways, upstream DNS servers etc, but would have a MAC based IP reservation within the DHCP scope.
oh sure, a reservation is very different. There is no anticipation of anything changing, just being centrally controlled in that sort of situation. You should always now what IP is serving your website though.
Distribution: Linux Mint 14 (Cinnamon), Xubuntu 12.04, Ubuntu 10.04
Posts: 49
Original Poster
Rep:
Quote:
Originally Posted by acid_kewpie
a web server has no business running on DHCP. That's just horrible.
Not sure I understand, so I'll answer both options I could think you meant
1. if you meant httpd & dhcp are on the same VM, well, they aren't
2. if you meant that a machine running httpd should have a static address and not get it dynamically, then I agree. However, that's a dev VM machine in a crazy world :-)
Quote:
Originally Posted by acid_kewpie
What I would suggest is seeing a difference between a hostname and a web domain it serves. A machine should be called by, and therefore registered to DHCP as, the name of the BOX, not of it's websites. the ONLY A record for that box should be the machine hostname. any subsequent sites that it hosts should then be defined statically in DNS as CNAME records pointing to that A record.
Sounds like a good plan. Just making sure I got it right
let's assume the machine's "real" hostname is my-funky-dev-server
my-funky-dev-server.example.com will get an IP from DHCP (the A record), which in turn will update the NS
in the NS, I'll set CNAME for all three sub-domains of my web app to point to my-funky-dev-server.example.com by name, and not by IP
Correct?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.