Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-15-2009, 04:24 PM   #1
LQ Newbie
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Permintly chainging the hosts file in linux

Hi i have a NAS running Linux ARM little endian glibc 2.2.5 , im trying to permanently change the hosts file in /etc/hosts but it keeps reverting to the default setup upon every boot .

Ive tried circumventing this with a script

chmod 777 /etc/hosts
cp -f /mnt/md1/public/hosts /etc/
This works when i enter it manually into putty but when i add it to one of the auto run scripts the hosts file is never canged . Ive had a look in /mnt/md1/local/etc/ but there isnt any hosts file in there and its not used when i copy it in that folder .

Any ideas ?
Old 04-15-2009, 04:26 PM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Well it sounds like the device boots out of a compressed system image. Is there any way to modify this image? That would be the only real way to permanently change it.
Old 04-15-2009, 04:47 PM   #3
LQ Newbie
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Im not sure i booted it without any HDD when i first bought it , and yet the operating system was there to format my hard disks to JBOD .

Ive searched the hard disks in and came up empty , That points to some sort of on board storage but its probably stored in flash rom or something like that so tampering is out .

Since changing the hosts files works via telnet that seems to be the easiest way to go . I cant understand why "cp -f /mnt/md1/public/hosts /etc/" fails to copy the file at startup but works in telnet .

Isnt there another command to add lines directly to a text file , i heard of it a while ago something like

"enter text here" >> /etc/hosts

i could try that if i newhow to use it


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
Chainging the PATH on login shells cliff76 Debian 5 06-16-2005 03:52 PM
Linux hosts file problem mikeheggy Linux - Networking 4 01-08-2005 11:52 AM
Is there a hosts file on linux? rwalkerphl Linux - Newbie 2 08-19-2004 01:43 PM
where is the hosts file in linux Lleb_KCir Linux - General 8 03-27-2004 10:59 AM
Windows using Linux Hosts file RJC Linux - General 0 08-20-2002 08:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:55 PM.

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