Dhcpleases: bad name in /var/dhcpd/var/db/dhcpd.leases
-
Hello,
I get a lot of times this in my log:
dhcpleases: bad name in /var/dhcpd/var/db/dhcpd.leases
How can I fix this?
Cheers!
-
Look at the hostnames that show up under Status > DHCP Leases. Odds are something has one that is not valid. Find it, fix the hostname. The rest will sort itself out.
-
I saw the list⦠so many.... how do i know what to find and fix? Thanks
-
I saw the list⦠so many.... how do i know what to find and fix? Thanks
Did anyone reply to you?
I have the same issue.
There is nothing obviously wrong, as my leaseĀ names seem to be okay.
Is there a document that states what is valid for a lease name? -
Same trouble and is associated with another error as follows
Last 50 General Log Entries. (Maximum 50) Time Process PID Message Sep 17 00:34:22 dhcpleases Could not deliver signal HUP to process because its pidfile (/var/run/dnsmasq.pid) does not exist, No such file or directory. Sep 17 00:36:37 dhcpleases bad name in /var/dhcpd/var/db/dhcpd.leases
To see content of these files, from the GUI go to Diagnostics/Edit File and load
/var/dhcpd/var/db/dhcpd.leases~
/var/dhcpd/var/db/dhcpd.leasesCan view / Edit contents.Ā I don't know what to look for in there so I'm just looking so far!
Found some hits about issues with unbound but nothing to help with troubleshooting / resolution.Ā Will keep rooting around in the forums but will come back here to update too if I have any success.
Please help.
-
"Use the source, Luke" - Obi WAN Code-obi
} else if (!canonicalise(hostname)) { if (foreground) printf("bad name(%s) in %s\n", hostname, leasefile);
canonicalise(char *s) { [...] else if (!legal_char(c) || (++dotgap > MAXLABEL)) return (0);
static int legal_char(char c) { if ((c >= 'A' && c <= 'Z') || Ā Ā (c >= 'a' && c <= 'z') || Ā Ā (c >= '0' && c <= '9') || Ā Ā c == '-' || c == '/' || c == '_' || c == ' ') return (1); return (0); }
So that routine will print that it's a bad name if any character is in the hostname that is not in the list it checks. It allows A-Z, a-z, 0-9, '-', '/', '_'. and ' ' and nothing else.
-
I have the same problem, but upon inspection there are NO illegal characters at all.
The only thing 'weird' is that some of my appliances or boxes (ie: Sling media, Playstation, etc.) don't seem to have a hostname in the DHCP leases screen, it's empty.Now, when I do a network scan, they certain pop up.Ā But I'm wondering if the blank hostname is producing the issue?Ā I also have the DNS responder running on the same box.
-
I'm also getting the same error as the OP, and looking at my host names one of them is HS110(UK). So it's the brackets causing the issue, but I can't change the host name on the device. I've tried adding a static IP and giving it a different host name but it still uses the one with brackets.
Is there anyway around this?
Also, just a thought but if a particular host name is causing that error to be added, would it not be a good idea to add the actual host name to the error? Although looking at the code @jimp posted it looks like the host name should be in the error, but it's not??? Unless of course that codes from a newer version than mine (2.3.2-RELEASE-p1).