LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-08-2013, 09:16 PM   #1
jjrojaspy
LQ Newbie
 
Registered: Jun 2013
Location: Venezuela
Distribution: Debian 7.7 Wheezy
Posts: 17

Rep: Reputation: 0
Question I'm getting a wrong hostname in the terminal


Hi everybody. A week ago I upgraded my Debian install from squeeze to wheezy. From time to time I get a funny bug on my terminal. I get random hostname. When I first installed Debian on my PC, I named my computer Anardil, so usually my command line looks like this

My user account -> jjrojaspy@Anardil:~$
root account -> root@Anardil:~#

But today i got this in my terminal:

jjrojaspy@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~$
root@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~#

just for the record, my current linux kernel is 3.2.0-4-amd64. Before upgrade it was 2.6.x.x-amd64.

Those anybody has a clue? Is this a Debian bug or something else? Thanks in advance!!!
 
Old 08-08-2013, 09:28 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,329
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
All I can say is that I have not run into that here on my Wheezy box. My terminal prompt still says

Quote:
[username]@tuna
My kernel is 3.2.0-4-686-pae.

(I name all my computers after sea creatures. There's tuna, hammerhead, narwhal, pickerel, and minnow--the netbook)
 
Old 08-08-2013, 09:42 PM   #3
jjrojaspy
LQ Newbie
 
Registered: Jun 2013
Location: Venezuela
Distribution: Debian 7.7 Wheezy
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks Frankbell. I know that this doesn't make any sense at all, but I didn't realize this was happening until i opened my terminal the day before yesterday; today I could observe the same anomaly. As I said, this happens from time to time.
 
Old 08-09-2013, 02:20 AM   #4
itlb
LQ Newbie
 
Registered: Aug 2013
Distribution: Debian
Posts: 29

Rep: Reputation: Disabled
I'm getting a wrong hostname in the terminal

Are you sure its the hostname and not just the prompt? what does 'hostname' report when your prompt changes?
 
Old 08-09-2013, 07:54 AM   #5
jjrojaspy
LQ Newbie
 
Registered: Jun 2013
Location: Venezuela
Distribution: Debian 7.7 Wheezy
Posts: 17

Original Poster
Rep: Reputation: 0
Yes, I'm sure it's not only the command line prompt. In fact, when i turned my computer on today, I checked the terminal once more and this is what i got ---and still get:

jjrojaspy@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~$ hostname
be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01
jjrojaspy@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~$ uname -a
Linux be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
jjrojaspy@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~$

and if i turn into root

root@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~# hostname
be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01
root@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~# uname -a
Linux be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
root@be4f4c87-dslam-172-17-193-239-269-660-mil-bras-01:~#

it's just the same.

Nevertheless, if i reboot my pc and go into Debian again, the terminal shows the correct prompt and hostname.
 
Old 08-09-2013, 08:11 AM   #6
scratchyrat
LQ Newbie
 
Registered: May 2010
Location: United Kingdom
Distribution: Debian, Red Hat, AIX, Ubuntu, Fedora
Posts: 27

Rep: Reputation: 3
What does it say in your /etc/hostname and /etc/hosts files?
 
Old 08-09-2013, 05:46 PM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Your problem should have shown up in Squeeze. You are really not supposed to use upper case letters in the host name.
 
Old 08-10-2013, 01:00 AM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I have had similar problems but I think that they were related to the installation cd's. I had an installation that said unknown as hostname
 
Old 08-10-2013, 05:42 PM   #9
jjrojaspy
LQ Newbie
 
Registered: Jun 2013
Location: Venezuela
Distribution: Debian 7.7 Wheezy
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks to all who have answered my question, but a i have a few more:

a hostname isn't supposed to use uppercase letters? Is this a *nix naming convention? or just a de facto rule among Linux users and administrators? I have two pc's in my office, one running Ubuntu and the other Xubuntu (12.04 in both cases), and they are call Local1 and Local2. As you can see, each hostname begins with an uppercase letter. On the other hand, before I upgraded my Debian installation I never got other hostname than the one a set up during the installation process.

I will check the hostname and hosts files on my PC and then I will be back to you. Thanks again!!
 
Old 08-11-2013, 12:20 AM   #10
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Is your debian directly connected to the net? (i.e. not through a router).
That looks like the ISP assigned rDNS of your connection.
Maybe your DHCP client is set to accept a hostname as well as ip/dns etc.
 
1 members found this post helpful.
Old 08-12-2013, 06:49 PM   #11
jjrojaspy
LQ Newbie
 
Registered: Jun 2013
Location: Venezuela
Distribution: Debian 7.7 Wheezy
Posts: 17

Original Poster
Rep: Reputation: 0
Hi everyone. I finally could check my hostname and hosts files in /etc

jjrojaspy@Anardil:/etc$ cat hostname
Anardil
jjrojaspy@Anardil:/etc$ cat hosts
127.0.0.1 localhost
127.0.1.1 Anardil.cantv.net Anardil

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
jjrojaspy@Anardil:/etc$

Any hint?

Last edited by jjrojaspy; 08-12-2013 at 07:02 PM.
 
Old 08-12-2013, 08:40 PM   #12
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,329
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I think you are making this more complicated than it is.

This article may help: http://www.cyberciti.biz/faq/debian-...e-permanently/

Here's the contents of my /etc/hostname:

Code:
~$ cat /etc/hostname
tuna
The following is from my /etc/hosts. It's similar to yours. Since I don't use ipv6, the ipv6 portion is irrelevant.

Code:
 cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 tuna.bell.org tuna.bell.org

# 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
 
Old 08-16-2013, 11:48 AM   #13
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

as already suggested by descendant_command the host name you see is being provided by the dhcp server and is being set by dhclient. You should be able to disable this behaviour in /etc/dhcp/dhclient.conf

Try removing the "host-name" option from the "request" line.

Evo2.
 
1 members found this post helpful.
Old 08-21-2013, 06:35 PM   #14
jjrojaspy
LQ Newbie
 
Registered: Jun 2013
Location: Venezuela
Distribution: Debian 7.7 Wheezy
Posts: 17

Original Poster
Rep: Reputation: 0
Hi everybody. I finally could solve the hostname issue. As I was suggested by evo2 and descendat_command, I commented the host-name option in the request line of my dhclient.conf file. This solved the problem. Thanks to all for helping me!!!
 
  


Reply



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
Changed hostname during install, now CUPS has wrong hostname on web interface slinx Linux - Software 1 08-07-2009 08:01 PM
sendmail using wrong hostname schentor Linux - Networking 6 12-09-2005 01:53 PM
RedHat Enterprise wrong hostname with POP3 AwoLtheMighty Red Hat 3 08-09-2005 10:38 PM
something is wrong with my hostname Paxmaster Linux - Networking 12 11-12-2004 06:17 PM
Wrong Hostname in a MS Domain Zeb Linux - Networking 0 03-16-2004 03:32 AM

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

All times are GMT -5. The time now is 09:21 PM.

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
Open Source Consulting | Domain Registration