Community discussions

MikroTik App
 
User avatar
Etz
Member Candidate
Member Candidate
Topic Author
Posts: 178
Joined: Thu Mar 27, 2014 10:09 am
Location: Estonia

Bug or feature? \00 in hostnames?

Tue Nov 04, 2014 9:26 am

I am currently observing strange behaviour on RouterOS (v.6.20).

Every linux based host has \00 in their hostname.
Windows Machines doesnt have it.

ros code

[admin@kari-crs] > /ip dhcp-server lease print
Flags: X - disabled, R - radius, D - dynamic, B - blocked
 #   ADDRESS                                                              MAC-ADDRESS       HOST-NAME                           SERVER                           RATE-LIMIT                           STATUS
 0   192.168.1.2                                                          60:A4:4C:8E:9C:90                                     dhcp-server1                                                          bound
 1   192.168.1.10                                                         00:11:32:28:9D:E7 Syno\00                             dhcp-server1                                                          bound
 2   192.168.1.16                                                         00:90:A9:69:B3:40 WDTVLive\00                         dhcp-server1                                                          bound
 3   192.168.1.17                                                         00:E0:36:EF:EE:D6                                     dhcp-server1
 4 D 192.168.1.251                                                        60:45:BD:EC:54:98 Surface-RT                          dhcp-server1                                                          bound
 5 D 192.168.1.250                                                        EC:F3:5B:50:EA:C4 Etzi-Lumia                          dhcp-server1                                                          bound
 6 D 192.168.1.248                                                        84:3A:4B:47:BD:68 MSA-4000237                         dhcp-server1                                                          bound
 7   192.168.1.15                                                         00:02:9B:CA:88:93                                     dhcp-server1                                                          bound
In a result, every Static DNS (for any Linux/BSD host), generated by the script has an whitespace between Hostname and domain, so they wont resolve. :(
Of course I could trim that "\00" in the script, but I would like to understand why it does that in a first place. ;)
 
MrYan
Member Candidate
Member Candidate
Posts: 160
Joined: Sat Feb 27, 2010 6:13 pm

Re: Bug or feature? \00 in hostnames?

Tue Nov 04, 2014 11:55 am

I see it with a Synology NAS as well. Don't recall if I saw it with Ubuntu Linux clients. I suspect that the host-name is the client identifier (option) which I don't think is a NULL terminated string. Chances are that the DHCP client is broken on embedded Linux devices.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Bug or feature? \00 in hostnames?

Tue Nov 04, 2014 12:21 pm

check settings on these devices, i have linux boxes running and have never seen trailing \00 for hostnames.

Check if /etc/hostname and /etc/hosts have newline at the end of the configuration file.
 
MrYan
Member Candidate
Member Candidate
Posts: 160
Joined: Sat Feb 27, 2010 6:13 pm

Re: Bug or feature? \00 in hostnames?

Tue Nov 04, 2014 12:42 pm

On mine the hostname file looks okay:
[duck] Matt>od -c hostname
0000000   d   s   1   1   0   j  \n
0000007
[duck] Matt>od -c hosts
0000000   1   2   7   .   0   .   0   .   1  \t   l   o   c   a   l   h
0000020   o   s   t  \n   1   9   2   .   1   6   8   .   1   4   4   .
0000040   8  \t   d   s   1   1   0   j  \n  \n  \n  \n  \n  \n  \n  \n
0000060  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n
*
0000260  \n  \n  \n  \n  \n  \n  \n  \n
0000270
 
User avatar
Etz
Member Candidate
Member Candidate
Topic Author
Posts: 178
Joined: Thu Mar 27, 2014 10:09 am
Location: Estonia

Re: Bug or feature? \00 in hostnames?

Tue Nov 04, 2014 2:15 pm

check settings on these devices, i have linux boxes running and have never seen trailing \00 for hostnames.

Check if /etc/hostname and /etc/hosts have newline at the end of the configuration file.
On WD TV you cannot check anything as you dont have SSH access at all or any other way to access config files.
On Synology, I will check later...but I really doubt that I find anything abnormal.

Anyway, it doesnt occure on any other router, verified with couple ones.
DD-WRT and OpenWRT, both show hostnames as they should be... ;)
On mine the hostname file looks okay:
Same here... :roll:
 
iqt
just joined
Posts: 23
Joined: Fri Jun 07, 2013 11:04 am

Re: Bug or feature? \00 in hostnames?

Wed Nov 05, 2014 11:52 am

I had a Qnap NAS (with original firmware) which gave the same result. I can't recall the hostname file, but the trailing \00 was only with ROS, not with OpenWRT.

It was annoying, because my dhcp lease-script set static dns names on ROS.

Now the NAS is on Debian and the problem is gone. :)
 
User avatar
Etz
Member Candidate
Member Candidate
Topic Author
Posts: 178
Joined: Thu Mar 27, 2014 10:09 am
Location: Estonia

Re: Bug or feature? \00 in hostnames?

Wed Nov 05, 2014 1:06 pm

It was annoying, because my dhcp lease-script set static dns names on ROS.
Well that is my actual problem with this..

And it doesnt occure on any other Router, regardless of OS...at least so far I havent found any that behaves the same way.
Tried OpenWRT, DD-WRT, Tomato, AsusWRT, IOS, JunOS, etc...
 

Who is online

Users browsing this forum: coreshock, GoogleOther [Bot], johnson73, StephenDig and 73 guests