LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 11-03-2009, 05:43 AM   #1
permalac
Member
 
Registered: Jul 2007
Location: Barcelona
Posts: 115

Rep: Reputation: 16
How to change the hostname at the end of pxe unattended installation on Debian


Hello,

I just installed a pxe server, and i'm installing debian with pxe . completely unattended with preseeding.

Now, all my installations come with the same hostname, how I can change the hostname to something different?

Thanks.
 
Old 11-03-2009, 05:52 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Change to show the correct hostname in
Code:
/etc/hostname
/etc/hosts
Of course if you have other services configured, like apache or something, where the hostname is used then you'll have to change accordingly in those config files.

Kind regards,

Eric
 
Old 11-03-2009, 06:06 AM   #3
permalac
Member
 
Registered: Jul 2007
Location: Barcelona
Posts: 115

Original Poster
Rep: Reputation: 16
The thing is that they come from a pxe unattended installation.

I was expecting a way to make it unattended, using the preseeding standard, if there is such thing.


thanks.
 
Old 11-04-2009, 12:08 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Ok, got it now Not familiar with the whole PXE booting. Sorry.

Kind regards,

Eric
 
Old 11-04-2009, 01:56 AM   #5
permalac
Member
 
Registered: Jul 2007
Location: Barcelona
Posts: 115

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by EricTRA View Post
Ok, got it now Not familiar with the whole PXE booting. Sorry.

Kind regards,

Eric
But you tried to help, very kind from your part. Thanks.

If one day you need to install several machines , or the same machine several times, i suggest you to try pxe installation.
 
Old 11-04-2009, 02:00 AM   #6
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Thanks for the advice.

Kind regards,

Eric
 
Old 11-05-2009, 01:17 AM   #7
permalac
Member
 
Registered: Jul 2007
Location: Barcelona
Posts: 115

Original Poster
Rep: Reputation: 16
answer from serverfault:


One simple way that comes to mind without setting up things in DHCP.

Assuming there is a web site you can add files to. Place the hostname inside a file based on the Mac. Then retrieve it with wget.

e.g.:

mac=`ifconfig eth0 | grep HWaddr | sed 's/^.*HWaddr //; s/://g'`
wget -O hostname.txt http://www.example.com/$mac
hostname `cat hostname.txt`

The mac file name would be in lower case with no colon ( characters.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PXE unattended installs aapje Linux - Newbie 8 10-04-2010 07:10 AM
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 09:36 PM
deploying unattended ubuntu installation... mia_tech Linux - General 6 01-03-2009 11:39 AM
Unattended remote installation [GOD]Anck Slackware 0 08-18-2008 06:49 AM
how to change hostname permanently in debian etch apachenew Debian 5 08-20-2007 08:11 PM


All times are GMT -5. The time now is 04:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration