problem with hostname


2009-07-07T02:54:45+00:00


Recently it changed to : 

<username>@(none):$ 

When I need to invoke sudo I get: 

<username>@(none):~$ sudo <command> 
sudo: unable to resolve host 
sudo: unable to resolve host 
sudo: unable to resolve host 
sudo: unable to resolve host 
[sudo] password for <username>: 

I can set the hostname with: 

sudo hostname <hostname> 

but the new hostname is not retained after reboot. 

Shouldn't the following define my hostname? 

<username>@(none):~$ cat /etc/hosts 
127.0.0.1 localhost 
127.0.1.1 <hostname> 
# The following lines are desirable for IPv6 capable hosts 
::1 localhost ip6-localhost ip6-loopback 
fe00::0 ip6-localnet 
ff00::0 ip6-mcastprefix 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 
ff02::3 ip6-allhosts 

<username>@(none):~$ cat /etc/hostname 
<hostname> 

How can I restore <hostname> permanently? 
TIA 
Paul 





ame&gt;:$<br><br>Recently it changed to:<br><br>&lt;username&gt;@(none):$<b=
r><br>When I need to invoke sudo I get:<br><br>&lt;username&gt;@(none):~$ s=
udo &lt;command&gt;<br>sudo: unable to resolve host<br>sudo: unable to reso=
lve host<br>sudo: unable to resolve host<br>sudo: unable to resolve host<br=
>[sudo] password for &lt;username&gt;:<br><br>I can set the hostname with:<=
br><br>sudo hostname &lt;hostname&gt;<br><br>but the new hostname is not re=
tained after reboot.<br><br>Shouldn't the following define my hostname?<br>=
<br>&lt;username&gt;@(none):~$ cat /etc/hosts<br>127.0.0.1 localhost<br>127=
.0.1.1 &lt;hostname&gt;<br># The following lines are desirable for IPv6 cap=
able hosts<br>::1 localhost ip6-localhost ip6-loopback<br>fe00::0 ip6-local=
net<br>ff00::0 ip6-mcastprefix<br>ff02::1 ip6-allnodes<br>ff02::2 ip6-allro=
uters<br>ff02::3 ip6-allhosts<br><br>&lt;username&gt;@(none):~$ cat /etc/ho=
stname<br>&lt;hostname&gt;<br><br>How can I restore &lt;hostname&gt; perman=
ently?<br>TIA<br>Paul<br><br><br><br><br></div></body></html>

Re: problem with hostname by Fred Roller on 2009-07-07T03:09:36+00:00
On Tue, 2009-07-07 at 02:51 +0000, pkaplan1@comcast.net wrote:
> How can I restore <hostname> permanently?

Using whatever editor your comfortable with edit /etc/hostname as root:
sudo vi /etc/hostname



"Life is like Linux, simple.  If you are fighting it, you are doing
something wrong."





Re: problem with hostname by on 2009-07-07T03:23:30+00:00
<hostn ame> 
<username>@(none):~$ 

and still <hostname> is not retained thru reboot. 
Paul 


"Life is like Linux, simple. If you are fighting it, you are doing 
something wrong." 




&lt;username&gt;@(none):~$<br><br>and still &lt;hostname&gt; is not retaine=
d thru reboot.<br>Paul<br><br>s root:<br>sudo vi /etc/hostname<br><br><br><br>
Loading


$ This page is proudly powered by www.pubbs.net, you can see more at ubuntu archive | Partners: Global Manufacturers