[SOLVED] Hostname: Thisfiletakesprecedenceoveretchostswhere

Some days ago I converted Arch to pure Systemd, which is a great system imho.
One lingering problem is that my /etc/hostname file (which has the same hostname as /etc/hosts is not effective?
I get the following:
handy ~ $ hostname
Thisfiletakesprecedenceoveretchostswhere
I have searched & can't find any information on this.
In /etc/hostname I have tried using each of the following to no avail:
righpc
"rightpc"
HOSTNAME="rightpc"
HOSTNAME=rightpc
Any ideas?
Last edited by handy (2012-08-18 09:52:04)

Thanks for your reply.
/etc/hostname :
handy ~ $ hostname
Thisfiletakesprecedenceoveretchostswhere
handy ~ $ cat /etc/hostname
# This file takes precedence over /etc/hosts where
# the hostname must also be included:
rightpc
/etc/hosts :
# /etc/hosts: static lookup table for host names
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost rightpc
#192.168.1.2 rightpc.localdomain rightpc ## the HP server
#192.168.1.3 leftpc.localdomain leftpc ## the iMac client
# End of file

Similar Messages

  • [SOLVED] Hostname lost

    Hello all,
    I tried all what I could, impossible to get my hostname back !
    I made an upgrade on a machine and lost the hostname !! This computer should be named crystal, but now I have :
    $ uname -n
    (none)
    $ echo $HOSTNAME
    Here is /etc/hosts :
    #<ip-address>   <hostname.domain.org>   <hostname>
    127.0.0.1       crystal.localdomain     crystal
    ::1             crystal.localdomain     crystal
    # End of file
    I tried installing everything I could like net-tools, coreutils, ypbind but nothing
    I don't have the `hostname` command.
    I've also put crystal in /etc/hostname.
    Don't now what to do now or where to search.... Any help please ?
    Last edited by Kooothor (2011-06-16 09:31:36)

    Thanks the problem is solved \o/
    Dunno if it was the new /etc/hosts format or the -Syu or both...
    Thanks guys

  • [solved] hostname command not found

    Some months ago i've got this problem:
    startx: line 127 hostname command not found
    that i solved with
    pacman -S net-tools
    Today the problem is here again O.o
    I've reinstalled net-tools and coreutils but nothing
    Last edited by polslinux (2011-08-26 11:31:26)

    http://mailman.archlinux.org/pipermail/ … 21397.html
    Edit: inetutils from [testing] http://www.archlinux.org/packages/testi … inetutils/ have the hostname binary and it was removed from the [testing] net-tools http://www.archlinux.org/packages/testi … net-tools/
    Packages in [core] still work the old way: net-tools provides hostname.
    Last edited by karol (2011-08-26 10:29:33)

  • [SOLVED] Hostname not showing in DHCP lease list

    This is a brand new installation using the new systemd base.
    Installed openbox as window manager and Network Manager.
    What did I miss that the hostname of this computer (opus) is not showing up in the DHCP Leases list?
    When I connect to the network using Network Manger(DHCP), hostname is not sent to the DHCP server (DNSmasq). It shows up as a "*":
    DHCP leases
    Hostname      IP-address                MAC-address            Lease expires
    *                     192.168.10.100        XX:XX:XX:XX:XX:XX    Nov 28th, 19:34
    *                     192.168.10.59          XX:XX:XX:XX:XX:XX    Nov 28th, 19:23
    alarmpi           192.168.10.69          XX:XX:XX:XX:XX:XX    Nov 28th, 16:56
    RM696            192.168.10.97          XX:XX:XX:XX:XX:XX    Nov 28th, 18:23
    (I blanked out the MAC-addresses.)
    The first entry is connecting through wireless. The second is wired.
    At the command line:
    hostname
    opus
    hostname -f
    localhost.localdomain
    /etc/hosts:
    # /etc/hosts: static lookup table for host names
    #<ip-address>    <hostname.domain.org>    <hostname>
    127.0.0.1    localhost.localdomain    localhost    opus
    ::1        localhost.localdomain    localhost    opus
    # End of file
    What file do I need to change and how?
    Updated:
    1) I created a /etc/dhclient.conf file and added:
    send host-name "opus";
    request subnet-mask, broadcast-address, time-offset, routers,
    domain-search, domain-name, domain-name-servers, host-name;
    and rebooted.
    This had no effect.
    2) Just for kicks, I uninstalled Network Manager and installed Wicd.
    This DID send the hostname and it displayed on the DHCP Leases List. But it also had the effect of turning off the WiFi radio.
    I did try to turn it back on: Went to the BIOS, made sure it was on (it was). Read some posts about power savings and what to do (tried them, didn't work).
    So I uninstalled Wicd, re-installed Network Manager and I am back to where I was.
    Last edited by dastagg (2012-11-29 11:15:11)

    Sorry, forgot to add this:
    https://bbs.archlinux.org/viewtopic.php?id=152376
    Follow the instructions on the bottom.

  • [SOLVED] Hostname always get set to localhost despite setting in...

    Hi,
    For some reason my hostname always get set to "localhost", but I want to have Arch for hostname.
    My configuration:
    [christer@localhost ~]$ cat /etc/hostname
    #Hostname
    Arch
    [christer@localhost ~]$
    [christer@localhost ~]$ cat /etc/hosts
    # /etc/hosts: static lookup table for host names
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 Arch.localhost.localdomain localhost.localdomain localhost Arch
    ::1 Arch.localhost.localdomain localhost.localdomain localhost Arch
    192.168.1.101 torr
    192.168.1.111 bubba
    192.168.1.102 fuel
    # End of file
    [christer@localhost ~]$
    I use static IP assigned with netcfg.
    [christer@localhost ~]$ cat /etc/network.d/eth0-static
    CONNECTION='ethernet'
    DESCRIPTION='A basic static ethernet connection using iproute'
    INTERFACE='eth0'
    IP='static'
    ADDR='192.168.1.100'
    ROUTES=('192.168.0.0/24 via 192.168.1.1')
    GATEWAY='192.168.1.1'
    DNS=('192.168.1.1')
    ## For IPv6 autoconfiguration
    IP6=stateless
    ## For IPv6 static address configuration
    #IP6='static'
    #ADDR6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
    #ROUTES6=('abcd::1234')
    #GATEWAY6='1234:0:123::abcd'
    [christer@localhost ~]$
    [christer@localhost ~]$
    In rc.conf I have.
    DAEMONS=(hwclock syslog-ng net-profiles netfs crond dbus cupsd mpd mpdscribble autofs iptables munin-node)
    Is it something in my /etc/hosts config thar missing so it defaults to localhost?
    Any ide whay I do not ger "Arch" as hostname?
    Best regards,
    /Christer
    Last edited by agkbill (2012-10-20 08:59:47)

    The problem was the empty lines and comment in /etc/hostname.
    I tried it back and forth and the problem was reproducible by adding the comment and empty lines in /etc/hostname again.
    Thank you for helping me with this!
    All the best,
    Christer
    PS:
    In the wiki "Editing Configuring Network" I added:
    /etc/hostname should not contain comments or empty lines.
    Last edited by agkbill (2012-10-20 10:51:07)

  • [SOLVED] Hostname appearing in titlebar

    Hi,
    I'm using ArchLinux with Openbox as a WM and LXDE as a DE.
    A while ago, I don't really know if it's after an update or what but in my windows' titlebar after the application title there is "(localhost)" written.
    Here's what it looks like :
    As I really don't need this, I'd like to remove it but after having searched what I could about Openbox and LXDE I haven't found anything.
    Thank you for your help.
    Last edited by tuvistavie (2012-09-30 17:51:11)

    Um, rc.conf is not what it used to be... That's the legacy way of setting a hostname. Basically, the new rc.conf has just the DAEMONS line in there. Everything else has been outsourced.
    See: https://wiki.archlinux.org/index.php/Rc.conf
    Last edited by DSpider (2012-09-30 18:27:14)

  • [solved]hostname / servername advice please

    hi, i have a samba share on my network, but the ip's are dhcp assigned. is there a way of using my machines host names to access the shares instead of the changing ip's? I read about /etc/hosts, but this appears to oonly work for static ip's to lookup hostnames.
    thanks
    Last edited by ninjaprawn (2012-03-23 22:01:10)

    cool, just playing with it now ta

  • [SOLVED] Hostname is "new-host" in router dhcp table

    I've just installed Arch Linux on a machine for the first time since the systemd changeover. Now, when I look at my router's DHCP connections, the computer hostname is listed as "new-host". However, I've set the correct hostname in /etc/hostname and run the hostnamectl command, and when I issue the command 'hostname' it tells me that my hostname is correct (i.e. something else than "new-host").
    So, where is my router getting this "new-host" hostname from? Is there another place where I should be configuring the hostname besides these?
    Last edited by nordog (2013-01-18 22:13:53)

    Saran: Thanks for the suggestion. I tried rebooting the router but it didn't do the trick.
    Tharugrim:
    tharugrim wrote:Try this: https://wiki.archlinux.org/index.php/Ne … e_problems
    Thanks for pointing this out to me. I added
    dhcp=dhcpcd
    to /etc/NetworkManager/NetworkManager.conf and that took care of the issue.
    Best regards

  • SOLVED: Hostname not on domain

    Hey, I've set up the following, but cannot get my hostname to get on the network. If I use the hostname command it comes up as set, but if I try to ping the hostname on a different network machine it does not resolve. I've got the following:
    rc.conf:
    HOSTNAME="ma"
    /etc/resolv.conf:
    domain XXXXXX.com
    search lol.XXXXXX.com private.XXXXXX.com XXXXXX.com
    nameserver 172.20.2.10
    /etc/hosts
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost myhost ma ma.lol.XXXXXX.com
    Last edited by beatbreaker (2011-11-03 04:50:35)

    beatbreaker wrote:If you're referring to DNS (like this? https://wiki.archlinux.org/index.php/DNS_with_bind ?) then I don't see how that will work.
    Yes, that is correct.
    beatbreaker wrote:My network already has a DNS, it works for every other machine on this network apart from the arch machine.
    Are you already running bind internally for lol.XXXXXX.com private.XXXXXX.com and/or XXXXXX.com?
    What are the other machines? If they are Windows or Mac's, then they may be using NetBIOS / WINS / mDNS (I'm not fully up to speed on the latest Windows/Apple name resolution systems) to resolve each other.
    All you've done at the moment is tell your computer what it is called; now you have to find a way to "announce" (or otherwise inform) the rest of the world (whether that is the whole internet, or just your LAN) what it is called. The normal (heterogeneous) way to do this is using DNS.
    Last edited by fukawi2 (2011-10-10 07:13:13)

  • [SOLVED] hostname functionality lost

    After a recent update I see that most of hostname's functionality is lost.  Unfortunately I use it in many scripts etc.  What is the "correct" alternative now?  I installed yp-tools but it does not include any hostname binary (or variant thereof).
    I obviously can compile net-tools (and/or it's components) myself but is there a formal package (or AUR) with the original functionality?
    Last edited by lefallen (2011-06-20 00:46:56)

    karol wrote:I think keeping net-tools for now would be the best choice.
    I think you misunderstand.  The issue is caused by the OFFICIAL ArchLinux changes within the net-tools package that provides hostname.  Specifically, this change I believe:
    http://projects.archlinux.org/svntogit/ … e7496e09cb (1.60-15).
    EDIT: Ah.  NVM, it appears 1.60-18 rectified this: http://projects.archlinux.org/svntogit/ … 478efd36ce
    Just another pacman -Suy required
    Last edited by lefallen (2011-06-20 00:46:00)

  • [SOLVED] Cannot browse by hostname - only by IP Address (!)

    Hi all,
    I have successfully got ALARM running on the previously largely useless GoFlex Home. (It took a while, as the original install didn't work on large partitions, but was successful once the amended recommended partition size was used.)
    I've set up a SAMBA share on the SATA Boot disk, and additionally mounted my terabyte USB media drive (so largely fulfilling my needs of extending my media library).
    What's puzzling me is that I can only browse by IP Address (192.168.10.2) and although I've assigned it a Static IP address that's work, it won't let me access it by Host Name (default = ALARM).
    I can ping/resolve by hostname (Netbios or FQDN), have entered into the local DNS server, and it appears on the Network scanner, NET VIEW and Windows Explorer. However, if I try and access it, it says "\\ALARM is not accessible". Same result on two Win 7 PCs. (One HAD credentials for the device, the other didn't)
    However, I just tried another Win 7 PC (the wife's Laptop) and IT can access the thing by name OK!! (It's not in the Domain, the others are, maybe that's the issue?)
    Aaargh!
    Thanks if you can help!!
    Cheers
    Brian
    Last edited by bmilnes (2011-11-01 21:40:56)

    OK, solved it myself. (After giving myself the "Domain" clue.)
    In the earlier (1Gb Flash drive) scenario, I'd tried to do Kerberos Authentication, which entailed changing the Local Security policies.
    This, however, on a Standard (no security) SAMBA setup, caused the authentication problem. Following the following Support article, and then waiting for propogation (GPUpdate /force never really does what you need at workstation level) cleared it all up...
    http://support.microsoft.com/kb/281648
    Brian

  • [Solved] Question mark instead of hostname dhcp lease list

    My router running OpenWRT (runs dnsmasq) doesn't always pick up the hostname from one of my Arch pc's. I've recently reinstalled 2 pc's and I always follow the same procedure but sometimes one of them is not showing a hostname in the list. It gets an ip address alright, its just that other pc's can't resolve the missing hostname. Until now I've worked around it but I rather just solve this little mistery.
    I've used both dhcpcd@ and NetworkManager, it happens with both, after more testing today it seems that it happens (more/exclusively) with NetworkManager.
    I checked journalctl --unit NetworkManager but I see no errors or warnings there, just info.
    In the system log on the router where dhcp messages are logged, I see some warnings, nothing relevant I think:
    Sat May 2 17:06:22 2015 daemon.warn odhcpd[916]: DHCPV6 SOLICIT IA_NA from 000100011cd684244c0bbead15ea on br-lan: ok fdab:ff96:6241::50a/128
    Sat May 2 17:06:23 2015 daemon.warn odhcpd[916]: DHCPV6 REQUEST IA_NA from 000100011cd684244c0bbead15ea on br-lan: ok fdab:ff96:6241::50a/128
    5 kern.debug kernel: [86847.150000] icmp6_send: no reply to icmp error
    Sat May 2 17:19:05 2015 kern.debug kernel: [86847.150000] icmp6_send: no reply to icmp error
    Sat May 2 17:19:05 2015 kern.debug kernel: [86847.150000] icmp6_send: no reply to icmp error
    Sat May 2 17:19:05 2015 kern.debug kernel: [86847.160000] icmp6_send: no reply to icmp error
    Sat May 2 17:19:09 2015 kern.debug kernel: [86851.140000] icmp6_send: no reply to icmp error
    Sat May 2 17:19:09 2015 kern.debug kernel: [86851.140000] icmp6_send: no reply to icmp error
    Other than that, I see my pc sending a DHCP request and getting a reply:
    5 daemon.info dnsmasq-dhcp[1336]: DHCPREQUEST(br-lan) 1.2.3.4 ec:a6:4c:fd:fe:ec
    Sat May 2 18:44:58 2015 daemon.info dnsmasq-dhcp[1336]: DHCPACK(br-lan) 1.2.3.4 ec:a6:4c:fd:fe:ec nucky
    I don't even know if the problem is with the pc's or the router but since its running Linux with dnsmasq, Im sure some knowledgable soul must have an idea about that too .
    Thanks for the help!
    Last edited by mouseman (2015-05-09 07:59:33)

    Marked as solved. Turned out to be an issue with OpenWRT. I upgraded to the latest trunk which also came with a later version dnsmasq. No more question marks and unresolvable hostnames .

  • ZSH using a different PS1 depending on hostname? [SOLVED]

    SOLVED
    Mikachu on irc.freenode.net #zsh gave me a good solution:
    case $HOST in
    TARDIS)
    hostcolor=blue
    CentzonTotochtin)
    hostcolor=cyan
    Highwind)
    hostcolor=white
    hostcolor=gray
    esac
    PS1="%{$fg[$hostcolor]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
    #PS1 thanks to Mikachu on irc.freenode.net #zsh
    /SOLVED
    A little background
    I've got around to setting up git in my home directory (leaving a '*' in ~/.git/info/exclude, and using 'git add -f $FILE') to make sure all my machines are using the same dotfiles, but I use a different PS1 based on what machine I'm using.  I'd love to have a single .zshrc I could drop into the git repo and use for all machines, as opposed to say, zsh evaluating a seperate '~/.PS1' I set up by hand on each machine.
    But getting to the point:
    My PS1 is this:
    PS1="%{$fg[cyan]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
    the only difference between the .zshrc on each machine is that the hostname is given a different color, so that the machine 'TARDIS' might have the hostname in PS1 as blue, machine 'Centzon' might have the hostname as cyan, and if the .zshrc is on any other host, the hostname in PS1 is just grey.  I'm not sure how to go about this with .zshrc, but here's a rough idea:
    eval hostname
    if hostname=TARDIS
    PS1="%{$fg[blue]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
    if hostname=Centzon
    PS1="%{$fg[cyan]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
    else
    PS1="%{$fg[grey]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
    Has anyone come up with something like this?  If not, how would I do something like this in ZSH?
    Last edited by 094TQ5 (2011-11-08 00:31:42)

    Well, there are different ways of achieving this.
    Solution 1:
    You can create a new output type which will be triggered and call a same driver program and the new smart form. I am sure you can customize as to what Purchasing document type will trigger which output type. Get in touch with someone in the function team to get this configured.
    Solution 2:
    No Customizing, let the configuration be the same, but in the driver program change the value of  "TNAPR-FONAM" immediately after the form entry_neu to the new form name based on the Purchasing document type.

  • [SOLVED] Setting hostname to...

    I have defined in my /etc/rc.conf my desired hostname Cyrodiil' and it also comes up in the boot output as "Setting hostname to Cyrodiil", however, when I type the command 'hostname', it outputs the hostname which I used ages ago, and not Cyrodiil.
    I can manually set the hostname with the command: 'hostname Cyrodiil', but this only holds out until I reboot again.
    Am I missing something?
    Solved: It did not have anything to do with /etc/hosts. It seems that the ssh server authentication keys have hardcoded within them the hostname and this caused the reverting back to the old hostname. I have regenerated the authentication keys and now the new hostname is now correct, even after reboot.
    Last edited by OutOfPhase (2008-11-27 14:26:40)

    Issue solved, see OP. Thanks all.

  • [Solved] A note and question about slow hostname lookups

    I reinstalled Arch recently and the first thing I noticed was slow resolve times on hostname lookups.  This didn't happen on all webpages but did on about 50% of them.  This also happened on downloads from pacman %100 percent of the time.  I have done a good bit of research and most of the points led to nssswich.  One website said to try using this in nsswitch.conf:
    hosts: files[NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=return] nis
    With this it appears (after about 20 minutes of testing) that firefox lookups are again behaving normal again.  However, pacman is still having slow lookups (about 30 seconds for each package).  Does anyone know what could be the problem here.  I dont' know much about nsswitch or how it could be the problem.  Is there a way to help return pacman to regular lookup times?
    Last edited by Gen2ly (2010-11-05 18:13:34)

    Yeah, no problem.
    # /etc/hosts: static lookup table for host names
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost pavilion
    # End of file
    # The Hosts File Project http://hostsfile.mine.nu
    # Global Advert Servers Blocklist - Personal Edition
    # Release 2010-1-26
    # Servers Verified as up and running 2010-1-26 (by dns exploration)
    # Updated sorted and maintained by Andrew Short (sh0rtie)
    # Contact: [email protected]
    # A big thank you to all contributers (too many to mention)
    # who really have made this project a success, well done :)
    # Licensed under the LGPL a copy of the license may be viewed at
    # http://www.gnu.org/licenses/lgpl.txt
    # WARNING:
    # This file is *extremely comprehensive* and some sites might be
    # included here that you wish to visit, if this is the case you can
    # deactivate the block on that site by placing a # (octothorpe)symbol
    # before its entry, this will deactivate blocking on that server
    # so for example #127.0.0.1 foobar.com
    # will enable you to visit foobar.com or you can just simply delete
    # the line that contains the site you wish to visit.
    # NB:
    # For some computer software updates you may need to disable
    # this file in order to perform the update, if you have problems
    # rename this file from "hosts" to "hosts.txt" reboot then perform
    # the update and then rename this file back to "hosts" to re-enable it
    # You must keep the below lines
    127.0.0.1 localhost
    127.0.0.1 007arcadegames.com
    127.0.0.1 00fun.com
    127.0.0.1 00inkjets.com
    127.0.0.1 00pro.com
    127.0.0.1 00web.com
    I use the hosts files to to block advertisements which is the stuff trailing on the end and continuing.  Think there might be a problemt here?

Maybe you are looking for

  • Subsequent debit - different behaviour for PO based IR and GR based IR

    Hy Guys, i am facing currently a problem with my understanding of system behaviour for GR Based Invoice Verification in combination with Subsequent Debit Postings... Example 1 - System Behaviour in case of PO based Invoice Verification: PO with 3000

  • I want to upgrade my iMac (Early 2009) 20-inch to 8GB of RAM

    I want to upgrade my iMac (Early 2009) 20-inch to 8GB of RAM the maximum specified by apple but i've been reading installing to 4GB RAM modules causes a kernal panic in os x lion, is this a lion specific error or is this a iMac error? Thanks for any

  • Oracle VM Server 2.2 Install Problems (Management Info Screen Skipped)?

    Hi, I am new to Oracle VM Server and I basically following the install guide to install the server on a spare machine we have in the office (a relatively new Dell with an i7 processor and 8gb memory) so we can evaluate it and play with it a bit. When

  • Sending password via sms instead of email

    Hello, when a user gets a new password the user receives an email with his new password. I want to know if it is possible to send the password via sms instead of email? We are running on NW04 SPS19 Patch 7. When i navigate to System Admin - System Co

  • HT5019 i do not have the arrangement tab in my display settings??

    i am trying to connect my 2011 macbook pro osx 10.6.8 to my sony hdtv and cannot get them to find each other. i have gone into display settings and do not seem to have the arrangement tab in bewteen display and colour. can anybody offer and help or a