LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to change the hostname at the end of pxe unattended installation on Debian (https://www.linuxquestions.org/questions/linux-server-73/how-to-change-the-hostname-at-the-end-of-pxe-unattended-installation-on-debian-766450/)

permalac 11-03-2009 05:43 AM

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.

EricTRA 11-03-2009 05:52 AM

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

permalac 11-03-2009 06:06 AM

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.

EricTRA 11-04-2009 12:08 AM

Ok, got it now ;) Not familiar with the whole PXE booting. Sorry.

Kind regards,

Eric

permalac 11-04-2009 01:56 AM

Quote:

Originally Posted by EricTRA (Post 3743667)
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. ;)

EricTRA 11-04-2009 02:00 AM

Thanks for the advice.

Kind regards,

Eric

permalac 11-05-2009 01:17 AM

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.


All times are GMT -5. The time now is 07:33 AM.