You are not logged in.
Hi,
I'm sure this question sounds very n00by, but this used to be working just fine in archlinux by setting the hostname variable and that was the network name as well. No issue and worked like a charme. However, i reinstalled my system and i got the (unpleasant) surprise of a lot of changes.
So, what's the "new" equivalent of HOSTNAME="pc-name" so that it works on the network again? I'm using just the default stock network stuff but with a static ip, no special things.
Right now i do have my hostname set in rc.conf but i can't ping my machine by that name. No, nothing in the local network changed. It really is only a reinstall of a local machine.
Cheers,
Mark
Offline
Do you also have the hostname set in /etc/hostname and /etc/hosts?
A host name is a unique name created to identify a machine on a network. With Arch Linux, a machine's host name is set in /etc/hostname or until a restart using the hostname command. Host names are restricted to alphanumeric characters. The hyphen (-) can be used, but a host name cannot start or end with it. Length is restricted to 63 characters.
Simply put your host name in to /etc/hostname (archlinux is the host name in this example):
archlinuxAfter setting a host name, it is also important to include the same host name in /etc/hosts. This will help processes that refer to the computer by its host name to find its IP address, as well as programs that rely on the gethostname() system call to determine the system's host name.
Edit /etc/hosts and add the same HOSTNAME you entered in /etc/hostname:127.0.0.1 archlinux.domain.org localhost.localdomain localhost archlinux
And do you have a nameserver in /etc/resolv.conf?
If none of this works, can you try using dhcp in your rc.conf just to make sure it's a config problem?
https://wiki.archlinux.org/index.php/HO … e_hostname
Last edited by 2ManyDogs (2012-08-06 16:08:58)
Offline
Do you also have the hostname set in /etc/hostname and /etc/hosts?
ArchWiki wrote:A host name is a unique name created to identify a machine on a network. With Arch Linux, a machine's host name is set in /etc/hostname or until a restart using the hostname command. Host names are restricted to alphanumeric characters. The hyphen (-) can be used, but a host name cannot start or end with it. Length is restricted to 63 characters.
Simply put your host name in to /etc/hostname (archlinux is the host name in this example):
archlinuxAfter setting a host name, it is also important to include the same host name in /etc/hosts. This will help processes that refer to the computer by its host name to find its IP address, as well as programs that rely on the gethostname() system call to determine the system's host name.
Edit /etc/hosts and add the same HOSTNAME you entered in /etc/hostname:127.0.0.1 archlinux.domain.org localhost.localdomain localhost archlinuxAnd do you have a nameserver in /etc/resolv.conf?
If none of this works, can you try using dhcp in your rc.conf just to make sure it's a config problem?
Hi,
I tried your suggestions and using dhcp it works partly.
This is my static config:
interface=eth0
address=192.168.1.99
netmask=255.255.255.0
broadcast=192.168.1.255
gateway=192.168.1.2
When i use dhcp (so comment out the lines except interface=eth0) then i do get the name assigned, but i can't ping the pc or access it by name. I can by ip.
If you have more suggestions, please do share ![]()
Cheers,
Mark
Offline
When i use dhcp (so comment out the lines except interface=eth0) then i do get the name assigned, but i can't ping the pc or access it by name. I can by ip.
Mark
You mean ping it from another machine? Does that machine have this one's name set in /etc/hosts?
I'm not a network expert, so I don't really have any more good ideas. I know there was just a thread about using a static IP address, so look for that...
(edit) Take a look at this: https://wiki.archlinux.org/index.php/Ar … n_Template
and this: https://bbs.archlinux.org/viewtopic.php … 5#p1142255
Last edited by 2ManyDogs (2012-08-06 16:37:16)
Offline
markg85 wrote:When i use dhcp (so comment out the lines except interface=eth0) then i do get the name assigned, but i can't ping the pc or access it by name. I can by ip.
MarkYou mean ping it from another machine? Does that machine have this one's name set in /etc/hosts?
I'm not a network expert, so I don't really have any more good ideas. I know there was just a thread about using a static IP address, so look for that...
(edit) Take a look at this: https://wiki.archlinux.org/index.php/Ar … n_Template
and this: https://bbs.archlinux.org/viewtopic.php … 5#p1142255
Adding it to /etc.hosts on the other machines was not required before and is unusable in my configuration.
I tried your other suggestions though that doesn't work either.
Guess i have to make a bug report for this then...
Offline
Guess i have to make a bug report for this then...
I wouldn't be so quick to assume it's a bug. As I said, I'm not a network expert and so far none have been here to give you better suggestions.
Offline
markg85 wrote:Guess i have to make a bug report for this then...
I wouldn't be so quick to assume it's a bug. As I said, I'm not a network expert and so far none have been here to give you better suggestions.
I'm not expecting it to be a bug to be honest ![]()
I'm expecting it to be an undocumented - or hidden - feature that i just haven't found yet.
But by the time i decided to post here, i've already had hours and hours of searching and attempts to get this issue fixed. With no luck at all ![]()
Offline
When you use a static IP address, try "dhcpcd -s" or "dhclient -S" in order to send your hostname to the DHCP server.
Last edited by progandy (2012-08-06 18:17:42)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
When you use a static IP address, try "dhcpcd -s" or "dhclient -S" in order to send your hostname to the DHCP server.
I just have a different solution. I do use DNSMasq on my router (dd-wrt), but i wasn't actually using it for anything. It was just sitting there being enabled. So i added a rule for my machine which is as simple as:
address=/pc-name/192.168.1.99
And it works. It is strange because i never had to do this before...
It is "solved" but certainly not to my liking.
Offline
Well, your nameserver has to know your hostname. There are several possibilites:
- you specify it in the nameserver config (what you did)
- the server gets its information via DHCP (either as part of the request or as a simple notification "-s")
- the server reacts to windows netbios broadcasts (on linux with samba and nmbd)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline