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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-27-2012, 02:46 AM
|
#1
|
|
Member
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 127
Rep:
|
setup hostname from DNS/DHCP dynamically
hello
i have a small setup with a few VMs that i use for testing stuff. And i would like to set these up so that i can have them getting their hostnames from the DNS/DHCP setup.
my VMs are either ubuntu or debian - so i would think they would require the same, or very similar, configurations.
but i have no idea what needs doing.
i am finding difficulty to find any valid information as the keywords that i have used for searching are not really helpful. i have tried searching for:
'hostname dynamic dns dhcp'
if somebody could be so kind to provide me with some idea of the configuration, it would be most appreciated.
thanks,
|
|
|
|
12-27-2012, 03:41 AM
|
#2
|
|
Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 5,369
|
No, most people leave the hostname alone. This box is RoseViolet wherever she goes.
A handy way of hacking this for yourself is to hack init scripts or the dhclient script to change hostname. Why do you need a different hostname?
|
|
|
|
12-27-2012, 12:50 PM
|
#3
|
|
Member
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 127
Original Poster
Rep:
|
i have a template of ubuntu and another for debian Virtual Machine.
so when i create/copy a new VM - i have to edit its hostname as the default will not do; TEMPLUBU, TEMPLDEB
I understand that tools such as Puppet would do this - but would be like just over the top for my requirements.
just to be clearer - there is no off-the-shelve solution for this in Linux?
thanks,
|
|
|
|
12-27-2012, 01:52 PM
|
#4
|
|
Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 5,369
|
If I'm right, the dhcp can give hostnames after a fashion.
The usual info is dns, and IP. You can grok a dhcp license file to see if there's a spot for hostnames. When it comes to hostname, the server can link an ip to a hostname by simply having a dns entry, and then the outside world makes that link. The dhcp server can link an ip to a mac address. But that's all server side. You can change your hostname by a command like
echo "ShyTalk" > /etc/hostname.
but nobody listens to that normally. Nobody interrogates it normally. If someone is listening, perhaps you should explain to us who and why.
|
|
|
|
12-27-2012, 01:59 PM
|
#5
|
|
Member
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 127
Original Poster
Rep:
|
so your suggestion would be to have a script that
after booting, collects the IP of host
nslookup - to collect the hostname for that IP, from the DNS
write that hostname into /etc/hostname
then reboot
is that what you are suggesting?
thanks,
|
|
|
|
12-27-2012, 03:12 PM
|
#6
|
|
Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 5,369
|
I'm not sure what you are trying to do and I'm not suggesting. I was pointing out that the most important thing is what the outside world thinks your hostname is, not what your box thinks it is.
|
|
|
|
12-27-2012, 03:52 PM
|
#7
|
|
Member
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 127
Original Poster
Rep:
|
thanks
i am back where i started.
regards,
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:14 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
|
|