PDA

View Full Version : How do I define the hostname ?



ASS-Ware
2011-04-04, 15:38
I have a Squeezebox Classic v3 and a Squeezebox Radio, both get their IP address from my local DHCP server and register themselves in my local DNS server, but they both register themselves with squeezebox.mydomain.local.
How do I change the hostname they use to register in DNS ?

The Squeezebox Classic has the name Squeezebox, the Squeezebox Radio had the name SqueezeboxRadio, so it looks like it does not use it's name as set in the web interface.

pski
2011-04-07, 17:07
I have a Squeezebox Classic v3 and a Squeezebox Radio, both get their IP address from my local DHCP server and register themselves in my local DNS server, but they both register themselves with squeezebox.mydomain.local.
How do I change the hostname they use to register in DNS ?

The Squeezebox Classic has the name Squeezebox, the Squeezebox Radio had the name SqueezeboxRadio, so it looks like it does not use it's name as set in the web interface.

Why do you want to do this? What are you trying to do?

P

ASS-Ware
2011-04-07, 17:17
Why do you want to do this? What are you trying to do?

P

Just want them correctly in my DNS server.

pski
2011-04-07, 18:41
Just want them correctly in my DNS server.

This makes no sense. Hostname has no context with DNS.

P

Put another way: what DNS server are you running locally?

epoch1970
2011-04-07, 23:32
You have to set the name in the player firmware (SB3) or settings (Radio)
http://forums.slimdevices.com/showthread.php?t=86593

ASS-Ware
2011-04-08, 03:05
This makes no sense. Hostname has no context with DNS.

P

Put another way: what DNS server are you running locally?

Yes it does.
The hostname is the first bit of a DNS entry.
hostname.domain.extension.

Example :
An Active Directory environment with domain name mydomain.local.
A computer is named pc1.
That computer will register itself in DNS with it's hostname pc1 and will then be known as pc1.mydomain.local.

My DNS server is a Windows 2003 machine running Microsoft DNS service.

ASS-Ware
2011-04-08, 03:10
You have to set the name in the player firmware (SB3) or settings (Radio)
http://forums.slimdevices.com/showthread.php?t=86593

Thanks, but unfortunately that doesn't work.
In SBS and in mysqueezebox.com both player have different names, still they both register in DNS as squeezebox.mydomain.local.

aubuti
2011-04-08, 05:01
I have no idea for the SB3, but I would think that for the Radio you would change the hostname in /etc/hostname. Have you tried that?

ASS-Ware
2011-04-08, 05:03
I have no idea for the SB3, but I would think that for the Radio you would change the hostname in /etc/hostname. Have you tried that?

Thanks.
Can you tell me how to change that ?

aubuti
2011-04-08, 05:08
It's a simple text file, currently with the word 'squeezebox' in it. Enable remote login on the Radio (Settings > Advanced > Remote login). Then login as root with the password 1234 and change the contents of /etc/hostname. You can login using tools like ssh or WinSCP. If you use ssh I assume the Radio has vi (like the Controller), but I'm not 100% on that.

ASS-Ware
2011-04-08, 05:17
It's a simple text file, currently with the word 'squeezebox' in it. Enable remote login on the Radio (Settings > Advanced > Remote login). Then login as root with the password 1234 and change the contents of /etc/hostname. You can login using tools like ssh or WinSCP. If you use ssh I assume the Radio has vi (like the Controller), but I'm not 100% on that.

Thanks, will try that tonight.

epoch1970
2011-04-08, 11:25
Thanks, but unfortunately that doesn't work.
In SBS and in mysqueezebox.com both player have different names, still they both register in DNS as squeezebox.mydomain.local.
I am positive setting the hostname in firmware works with SB3 with a dhcp server set to update the DNS.
Blame something else than the player.
(Can't say for a Radio, I don't have one)

EDIT for posterity. You can get indeed an SB3 or SB Boom to set a custom hostname, forward and reverse resolution without any problem. Of course any of this won't happen if you just change the player name preference field in SB Server. You need to set the name in firmware and/or configure DHCP and/or DNS server records. Georgetown, here, is an SB Classic sending its hostname to a DHCP server that updates the DNS managing the "dyn.foo." domain (dnsmasq). That domain is being delegated by a static DNS server that manages domain "foo." (bind).

odessa:~ me$ dig georgetown.foo

; <<>> DiG 9.6.0-APPLE-P2 <<>> georgetown.foo
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55189
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;georgetown.foo. IN A

;; ANSWER SECTION:
georgetown.foo. 86400 IN CNAME georgetown.dyn.foo.
georgetown.dyn.foo. 5 IN A 172.17.10.2

;; AUTHORITY SECTION:
dyn.foo. 86400 IN NS dns.foo.

;; ADDITIONAL SECTION:
dns.foo. 86400 IN A 172.17.0.2

;; Query time: 11 msec
;; SERVER: 172.18.0.2#53(172.18.0.2)
;; WHEN: Sat Apr 9 09:54:15 2011
;; MSG SIZE rcvd: 114

odessa:~ me$ dig -x 172.17.10.2

; <<>> DiG 9.6.0-APPLE-P2 <<>> -x 172.17.10.2
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12845
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;2.10.17.172.in-addr.arpa. IN PTR

;; ANSWER SECTION:
2.10.17.172.in-addr.arpa. 5 IN PTR georgetown.dyn.foo.

;; AUTHORITY SECTION:
10.17.172.in-addr.arpa. 86400 IN NS dns.foo.

;; ADDITIONAL SECTION:
dns.foo. 86400 IN A 172.17.0.2

;; Query time: 7 msec
;; SERVER: 172.18.0.2#53(172.18.0.2)
;; WHEN: Sat Apr 9 09:55:00 2011
;; MSG SIZE rcvd: 111

odessa:~ me$ sudo nmap -O -sU -p 20-3500 georgetown.foo

Starting Nmap 4.68 ( http://nmap.org ) at 2011-04-09 09:55 CEST
Interesting ports on georgetown.dyn.foo (172.17.10.2):
Not shown: 3479 closed ports
PORT STATE SERVICE
68/udp open|filtered dhcpc
3484/udp open|filtered unknown
MAC Address: 00:04:20:01:02:03 (Slim Devices)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: print server|router|media device
Running: D-Link embedded, Silicondust embedded
OS details: D-Link DPR-1260 print server, or DGL-4300 or DIR-655 router, Silicondust HDHomeRun set top box
Network Distance: 1 hop

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 2.646 seconds
odessa:~ me$ The same results can be achieved with modern players. Touching /etc/hostname, like setting the hostname in firmware on older players is not necessary provided the DHCP and/or DNS server are configured properly.

ASS-Ware
2011-04-08, 12:33
I am positive setting the hostname in firmware works with SB3 with a dhcp server set to update the DNS.
Blame something else than the player.
(Can't say for a Radio, I don't have one)

When I remove the DNS entries, change the DHCP reservation for my SB3, option 12, hostname sb3, reboot the SB3, it registers itself as squeezebox.mydomain.local.
So that doesn't work.

When I change SB3's name in the SBS webinterface into SB3, the squeezebox registers itself as sb3.mydomain.local.
This works, yes, but not for the Squeebox Radio.

Not blaming the SB3, but I am blaming the SB Radio.

aubuti
2011-04-08, 13:17
Not blaming the SB3, but I am blaming the SB Radio.
Blaming it for what? Change it in the correct place (/etc/hostname) and then blame it if that doesn't work.

ASS-Ware
2011-04-08, 13:40
It's a simple text file, currently with the word 'squeezebox' in it. Enable remote login on the Radio (Settings > Advanced > Remote login). Then login as root with the password 1234 and change the contents of /etc/hostname. You can login using tools like ssh or WinSCP. If you use ssh I assume the Radio has vi (like the Controller), but I'm not 100% on that.

Excellent, this works perfectly, thank you.

ASS-Ware
2011-04-08, 13:42
Blaming it for what? Change it in the correct place (/etc/hostname) and then blame it if that doesn't work.

Yup, that works, so now I wonder why changing it in the website of SBS doesn't do the same, as it works for the SB3.
Thnx.

JJZolx
2011-04-08, 13:57
Yup, that works, so now I wonder why changing it in the website of SBS doesn't do the same, as it works for the SB3.

Completely different software running on the newer Squeezeboxes. A lot of things either work differently, don't work at all, or were left undone.

ASS-Ware
2011-04-08, 14:25
Completely different software running on the newer Squeezeboxes. A lot of things either work differently, don't work at all, or were left undone.

Sure, I understand, but as I am running the latest SBS software and have the option, I wonder why then I can change it without any result.

aubuti
2011-04-08, 15:15
Sure, I understand, but as I am running the latest SBS software and have the option, I wonder why then I can change it without any result.
Without _any_ result? Are you saying that if you change the name on the Radio it doesn't change the player name that is displayed on the SB Server software? If that's the case, then indeed something isn't working right for you.

If, on the other hand, you only mean that it doesn't change how it shows up in your DNS, then I would conclude that that isn't what that setting is intended for. Certainly a typical user is more interested in identifying different players than some home LAN DNS table. I'm curious, does doing this serve a purpose for you other than looking good in your DNS?

ASS-Ware
2011-04-08, 15:26
Without _any_ result? Are you saying that if you change the name on the Radio it doesn't change the player name that is displayed on the SB Server software? If that's the case, then indeed something isn't working right for you.

If, on the other hand, you only mean that it doesn't change how it shows up in your DNS, then I would conclude that that isn't what that setting is intended for. Certainly a typical user is more interested in identifying different players than some home LAN DNS table. I'm curious, does doing this serve a purpose for you other than looking good in your DNS?

Well, with many IP addresses in my LAN, ping -a x.x.x.x gives me a hostname so I know what certain IP addresses are used for (I do not remember them all).
But what I mean is that I find it odd that I can change the hostname on the SBS website for SB3 devices and not for SB Radio devices, for DNS registration.

paulster
2011-04-08, 15:30
Exactly.

Naming them within SBS is so the user can identify which device is which with a meaningful name through the web interface and from the graphical controllers. But this meaningful name can also include spaces and other characters which wouldn't be allowed in a hostname.

Setting the hostname in DNS serves absolutely no purpose to the typical user, who shouldn't even have to know which IP address is allocated to which device, and is only a concern if you run DNS locally and want to have a pretty looking table. But it still doesn't achieve anything useful or essential.

If you really find yourself needing to SSH into the devices and need to SSH as devicename.dnsdomain then you've probably got bigger problems that just enjoying your music.

JJZolx
2011-04-08, 15:33
Well, with many IP addresses in my LAN, ping -a x.x.x.x gives me a hostname so I know what certain IP addresses are used for (I do not remember them all).

If it's that important to you, set up DHCP reservations for each Squeezebox and then create the host records on your DNS server yourself. You know that plan A doesn't work, so try plan B.

ASS-Ware
2011-04-08, 15:39
Naming them within SBS is so the user can identify which device is which with a meaningful name through the web interface and from the graphical controllers. But this meaningful name can also include spaces and other characters which wouldn't be allowed in a hostname.

Setting the hostname in DNS serves absolutely no purpose to the typical user, who shouldn't even have to know which IP address is allocated to which device, and is only a concern if you run DNS locally and want to have a pretty looking table. But it still doesn't achieve anything useful or essential.

First of all, it's not just a pretty looking table, it's a correct table.
If all SB devices register themselves with the same name, then my reverse lookup table is incomplete, because more devies with the same name can only be registered once in the reverse lookup table.

Second, if this is of no concern, then why does it work with the SB3 and not a newer device ?


If you really find yourself needing to SSH into the devices and need to SSH as devicename.dnsdomain then you've probably got bigger problems that just enjoying your music.

I did not visit this forum to get offended and do not like your comment.
If you don't want to read my posts or don't agree with my way of thinking, or don't understand why I want certain things, then please do not respond.

ASS-Ware
2011-04-08, 15:41
If it's that important to you, set up DHCP reservations for each Squeezebox and then create the host records on your DNS server yourself. You know that plan A doesn't work, so try plan B.

Did that, in fact, most devices in my LAN have a reservation, but the DHCP server is set to register DHCP hosts in DNS (because of many devices).

aubuti
2011-04-08, 15:53
Second, if this is of no concern, then why does it work with the SB3 and not a newer device ?
Because, just like JJZolx said several posts ago, the SB3 and Radio have completely different firmware. It works on an SB3 because it's vestigial and/or there's no other way to change it, because you can't ssh into the SB3.

ASS-Ware
2011-04-08, 15:55
Because, just like JJZolx said several posts ago, the SB3 and Radio have completely different firmware. It works on an SB3 because it's vestigial and/or there's no other way to change it, because you can't ssh into the SB3.

But, my simple way of thinking, I use the latest SBS software which is aware of SB3 and SB Radio, gives me an option with both devices and this option does not work the same on SB3 and SB Radio, I find that odd.

JJZolx
2011-04-08, 15:56
Did that, in fact, most devices in my LAN have a reservation, but the DHCP server is set to register DHCP hosts in DNS (because of many devices).

That's not a problem at all. You can have more than one name mapped to a given IP address in DNS. It's common practice. Just manually add address records to your DNS server's '.local' zone for devices where the DHCP server doesn't register the desired host name.

ASS-Ware
2011-04-08, 15:59
That's not a problem at all. You can have more than one name mapped to a given IP address in DNS. It's common practice. Just manually add address records to your DNS server's '.local' zone for devices where the DHCP server doesn't register the desired host name.

You say "You can have more than one name mapped to a given IP address in DNS" but that is not the case here.
I have multiple devices and all devices have different IP addresses, but by default they use the same hostname, thus, only the last switched on device as a reverse-lookup entry.

JJZolx
2011-04-08, 16:06
You say "You can have more than one name mapped to a given IP address in DNS" but that is not the case here.
I have multiple devices and all devices have different IP addresses, but by default they use the same hostname, thus, only the last switched on device as a reverse-lookup entry.

I was talking about forward name lookups, not reverse-lookups. Is that really necessary just for you to manage a home network, or are you running your Squeezeboxes in the corporate offices of General Electric?

ASS-Ware
2011-04-08, 16:09
I was talking about forward name lookups, not reverse-lookups. Is that really necessary just for you to manage a home network, or are you running your Squeezeboxes in the corporate offices of General Electric?

Like I said in a previous post, I sometimes use ping -a to see what an IP address is used for, I do not remember them all.

But let's drop the why, I have found the solution how to.

aubuti
2011-04-08, 16:19
But, my simple way of thinking, I use the latest SBS software which is aware of SB3 and SB Radio, gives me an option with both devices and this option does not work the same on SB3 and SB Radio, I find that odd.
Look at it this way: the Radio's more sophisticated OS allows more precise functionality. One can use the SBS ui to set a user-friendly name that includes spaces or characters that aren't legal for DNS. This serves the bulk of users who want to distinguish players by familiar names. For the smaller group of users who want to set an SB's hostname, they can go in and edit /etc/hostname, the same way you would on a lot of computers.

The second option isn't available in the SB3, so the SBS ui sets both names.

In other words, the Radio's behavior isn't a bug, it's a feature. And the SB3's behavior is a firmware limitation.