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!!! |
All I can say is that I have not run into that here on my Wheezy box. My terminal prompt still says
Quote:
(I name all my computers after sea creatures. There's tuna, hammerhead, narwhal, pickerel, and minnow--the netbook) |
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.
|
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?
|
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. |
What does it say in your /etc/hostname and /etc/hosts files?
|
Your problem should have shown up in Squeeze. You are really not supposed to use upper case letters in the host name.
|
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
|
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!! |
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. |
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? |
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 Code:
cat /etc/hosts |
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. |
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!!!
|
All times are GMT -5. The time now is 12:01 AM. |