X-Git-Url: https://git.ralfj.de/dyn-nsupdate.git/blobdiff_plain/4c50ee5d8b2eb10d1fa5a1c8ec340fb769614ffd..ecc6d7d76571926b6011a3396b5b8d9458d713fc:/dyn-nsupdate.cpp diff --git a/dyn-nsupdate.cpp b/dyn-nsupdate.cpp index fd804d0..b0a7aed 100644 --- a/dyn-nsupdate.cpp +++ b/dyn-nsupdate.cpp @@ -56,6 +56,7 @@ int main(int argc, const char ** argv) property_tree::ptree config; property_tree::ini_parser::read_ini(CONFIG_FILE, config); std::string nsupdate = config.get("nsupdate"); + unsigned server_port = config.get("port", 53); /* Given the domain, check whether the password matches */ optional correct_password = config.get_optional(path(domain+"/password", '/')); @@ -86,7 +87,7 @@ int main(int argc, const char ** argv) exit(1); } /* exec nsupdate */ - execl(nsupdate.c_str(), nsupdate.c_str(), "-l", (char *)NULL); + execl(nsupdate.c_str(), nsupdate.c_str(), "-p", std::to_string(server_port).c_str(), "-l", (char *)NULL); /* There was an error */ std::cerr << "There was an error executing nsupdate." << std::endl; exit(1);