|
@@ -27,8 +27,9 @@ ActionAddHost::ActionAddHost()
|
27
|
27
|
|
28
|
28
|
const std::string ActionAddHost::getSql() const
|
29
|
29
|
{
|
|
30
|
+ auto host = _host.empty() ? _domain : _host + "." + _domain;
|
30
|
31
|
auto query = "INSERT INTO records (domain_id, name, type, content, ttl, prio, change_date)\n"
|
31
|
|
- " VALUES(@domain_id, \"" + _host + "." + _domain + "\", \"" + _recordType + "\","
|
|
32
|
+ " VALUES(@domain_id, \"" + host + "\", \"" + _recordType + "\","
|
32
|
33
|
" \"" + _recordValue + "\", 84600, 0, " + std::to_string(time(nullptr)) + ");\n";
|
33
|
34
|
|
34
|
35
|
if (_reverseEnabled && _recordType == "A")
|