OpenVPN - adding hosts to DNS so they can be resolved

If you don’t want to parse the status file, openvpn has a configuration option to run a script at client connection. This is from the man page.

–client-connect cmd
Run command cmd on client connection.

          cmd consists of a path to script (or executable program), optionally followed by arguments. The path and arguments may be single- or double-quoted and/or escaped using  a
          backslash, and should be separated by one or more spaces.

          The  command is passed the common name and IP address of the just-authenticated client as environmental variables (see environmental variable section below).  The command
          is also passed the pathname of a freshly created temporary file as the last argument (after any arguments specified in cmd ), to be used by the command  to  pass  dynami-
          cally generated config file directives back to OpenVPN.

          If the script wants to generate a dynamic config file to be applied on the server when the client connects, it should write it to the file named by the last argument.

          See the --client-config-dir option below for options which can be legally used in a dynamically generated config file.

          Note that the return value of script is significant.  If script returns a non-zero error status, it will cause the client to be disconnected.