gclayburg / synology-diskstation-scripts

Update Synology DNS records from DHCP IP address reservation
169 stars 41 forks source link

special characters in hostnames #12

Closed enhanced closed 8 years ago

enhanced commented 8 years ago

I'm too old school, I'll see if I can get a pull request submitted but I'm so use to things like SVN lol..

I digress, many hostnames these days have special characters such as a dash "-" in them. The version of named that Synology is shipping blows up when these types of hostnames exist and will not load the zone file. Given this, something like the following (or strip out the - and not the whole hostname):

               if (NAME !~ /-/) {
                    if (RecordType == "PTR") {print 1000 + arr[4] "\t" ReverseIP ".in-addr.arpa.\t" RENEW "\tPTR\t" NAME "." YourNetworkName ".\t;dynamic"}
                    if (RecordType == "A") print 2000 + arr[4] "\t" NAME "." YourNetworkName ".\t" RENEW "\tA\t" IP "\t;dynamic"
               }
gclayburg commented 8 years ago

Ok, so you are proposing this script should just ignore dhcp hostnames that contain a dash then? I wonder why named is blowing up for you. I haven't tried it, but I would think a dash should be valid. Maybe this script is getting confused somehow. Could you post the error message you are getting along with the named conf file that was generated?

Update: actually I just checked my zone file and it contains names such as Gary-iPad so it looks like it is working in my setup.

BTW, creating a pull request is pretty easy and fun! Just fork this repository and follow this: https://help.github.com/articles/creating-a-pull-request/

gclayburg commented 8 years ago

closed for lack of activity