LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 03-04-2005, 12:57 AM   #1
markjsutton
LQ Newbie
 
Registered: Oct 2004
Distribution: rh 7.2, dsl, mandrake
Posts: 11

Rep: Reputation: 1
changing computer "name" on network


i am a linux newbie. i have recently installed Mandrake 10.1 on 2 machines: a celeron and an AMD K6-2. the K6-2 has an additional hdd formatted as NTFS and is a samba share. everything works fine except both linux computers have the same name; "localhost", which windows wont allow. (no access to the NTFS drive from windows). haha! this is actually a windows problem! but seriously, how do i go about changing the name "localhost" so i can use both linux computers on the network at the same time? i have tried to solve myself by browsing around similar threads and tring different network settings (in KDE, just starting to use a terminal, not good with it yet, lots of commands to learn
any help will be appriciated, meanwhile, i'll keep mucking about.
 
Old 03-04-2005, 01:43 AM   #2
bunnadik
Member
 
Registered: Jan 2005
Location: vik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
1. Edit /etc/sysconfig/network and set "HOSTNAME=your-new-hostname"
2. Reboot.
3. Profit.

(you can probably just do 'hostname your-new-hostname' in a terminal w/o the reboot
but the above makes it permanent)

- Peder

Last edited by bunnadik; 03-04-2005 at 01:45 AM.
 
Old 03-04-2005, 01:49 AM   #3
markjsutton
LQ Newbie
 
Registered: Oct 2004
Distribution: rh 7.2, dsl, mandrake
Posts: 11

Original Poster
Rep: Reputation: 1
thank you. i did so and all is good now.
 
Old 03-22-2005, 04:57 PM   #4
fr8_liner
LQ Newbie
 
Registered: May 2004
Location: Lancaster County PA, USA
Distribution: Mandrake 10.1
Posts: 17

Rep: Reputation: 0
I have the same sort of problem with MDK 10.1. Since I booted up my system with a Knoppix 3.7 CD to troubleshoot some settings, I have been unable to change the hostname from "Knoppix". I can change it temporarily with the hostname command, but it comes back to "Knoppix" after a reboot.

My /etc/sysconfig/network file only contained one statement: "NETWORKING=yes". I added "HOSTNAME=my-hostname". That doesn't help after a reboot.

I have tried looking at many different files referred to in the man pages for hostname. Nothing seems to agree with the man pages in either content or directory structure.

And why does Knoppix change a configuration file when I didn't give it permission to write to the hard drive? That worries me a bit.

Anybody have any ideas? Thanks.

Last edited by fr8_liner; 03-22-2005 at 04:59 PM.
 
Old 03-23-2005, 01:09 AM   #5
bunnadik
Member
 
Registered: Jan 2005
Location: vik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
Are you sure you have removed the Knoppix CD? Perhaps you're still booting from it.

Otherwise check /etc/rc.sysinit. That's where the hostname is set at boot. Perhaps
you've got some junk there.

- Peder
 
Old 03-23-2005, 09:03 AM   #6
fr8_liner
LQ Newbie
 
Registered: May 2004
Location: Lancaster County PA, USA
Distribution: Mandrake 10.1
Posts: 17

Rep: Reputation: 0
Quote:
Originally posted by bunnadik
Are you sure you have removed the Knoppix CD? Perhaps you're still booting from it.

Otherwise check /etc/rc.sysinit. That's where the hostname is set at boot. Perhaps
you've got some junk there.

- Peder
Hi Peder,
Yes I am sure the Knoppix CD is not causing this. I last had it in the drive over a week ago and have restarted the machine from LILO many times since then.

I have looked at /etc/rc.sysinit and it contains one statement about hostname:
HOSTNAME='/bin/hostname'

If you look at my /bin/hostname file you find what looks like 6 lines of binary data, some error messages, and then what looks like the help option from the hostname command. My problem is I don't know what this file should look like. I have the contents of the /bin/hostname file shown below. Does this look normal or is this file corrupted?

.ELF.......................4..........4. ...(.........4...4...4........................................................
.................................................................................................... ......7..............i
............. ..................................... ..................... .........................
....D$.Z.t.......uF.|$.#t..tV..u..\$.@....L$..4$M.u..$.\[^_]..t&..t$.......l$...$z
.$#...-....D$.E.$#.....U./....D$.....$...X...........?.......t.A................'....E.
...,x.....$..U.WV1S....[.3..... ......).9s..E...EF9r..[^_].&....U.WVS....
.%s: name too long
.Setting domainname to `%s'
.r.>> %s
.%s: can't open `%s'
.domain.file.fqdn.help.long.short.version.verbose.alias.ip-address.nis.yp.net-tools./usr/share/locale.ypdomainname.dnsdomai
%s
.nisdomainname.%s.getdomainname()=`%s'
.gethostname()=`%s'
.Resolving `%s' ...
.Result: h_name=`%s'
.Result: h_aliases=`%s'
.Result: h_addr_list=`%s'
....%s: you must be root to change the host name
...%s: you must be root to change the domain name
.Usage: hostname [-v] {hostname|-F file} set hostname (from file)
.. domainname [-v] {nisdomain|-F file} set NIS domainname (from file)
.... hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name
.... hostname [-v] display hostname

. hostname -V|--version|-h|--help print info and exit
. dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

.... -s, --short short host name
.. -a, --alias alias names
.. -i, --ip-address addresses for the hostname
... -f, --fqdn, --long long host name (FQDN)
.... -d, --domain DNS domain name
.. -y, --yp, --nis NIS/YP domainname
.... -F, --file read hostname or NIS domainname from given file

. This command can read or set the hostname or the NIS domainname. You can
also read the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
....%s: You can't change the DNS domain name with this command
.
Unless you are using bind or NIS for host lookups you can change the DNS
..domain name (which is part of the FQDN) in the /etc/hosts file.
.......................d..............F..............f..............h..............f.......... ....s..............V..
..............................@...............x..H...d.......$.....................H..... ..<...........
...R.............................................$............... ...........o...o....o........................
.......*...:...J...Z...j...z..........................shstrtab..interp..note.ABI-tag..hash..dynsym..dynstr..gnu.version.
 
Old 03-23-2005, 10:03 AM   #7
bunnadik
Member
 
Registered: Jan 2005
Location: vik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
Hehe... perhaps I was a bit unclear. I'm not able to judge the possible corruptness of a binay by looking
at it (yet)

The backtics surrounding /bin/hostname in "HOSTNAME=`/bin/hostname`" means "run this command and put
the result in the variable HOSTNAME".

Right below that line you should have some lines :
Code:
if [ -f /etc/sysconfig/network ]; then
    . /etc/sysconfig/network
fi
That's where rc.sysinit reads an eventual HOSTNAME value and a bit further down you should have a
Code:
# Set the hostname.
action "Setting hostname %s: " ${HOSTNAME} hostname ${HOSTNAME}
This is where your hostname is actually set.

You can also run
Code:
find /etc -exec grep -iH knoppix {} \;
to see if there's any file that contains the (case insensitive) word knoppix.

- Peder
 
Old 03-23-2005, 05:41 PM   #8
fr8_liner
LQ Newbie
 
Registered: May 2004
Location: Lancaster County PA, USA
Distribution: Mandrake 10.1
Posts: 17

Rep: Reputation: 0
Hi Peder,

Thanks for getting back to me on this. I found so many files with the search that it will take me a while to go through them all. I am confident the answer is in there somewhere. I'll let you know how I make out.
 
  


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
SSH issue ""Server unexpectedly closed network connection" Errsta_Fonzarelli Linux - Software 12 05-24-2010 02:35 PM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
mambo: changing "Poll" to say "Encuesta" eantoranz Linux - Software 2 03-28-2006 11:35 AM
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM
"ifcfg-ethx" and "network-functions" files peok Linux - Networking 12 08-13-2003 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration