diff --git a/include/haproxy/resolvers-t.h b/include/haproxy/resolvers-t.h index dc1381b5c..b7274630c 100644 --- a/include/haproxy/resolvers-t.h +++ b/include/haproxy/resolvers-t.h @@ -163,6 +163,7 @@ struct resolvers { struct { const char *file; /* file where the section appears */ int line; /* line where the section appears */ + int implicit; /* config was auto-generated and must be silent */ } conf; /* config information */ }; diff --git a/src/resolvers.c b/src/resolvers.c index bcfd8783a..1f894ab48 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -2509,8 +2509,10 @@ static int resolvers_finalize_config(void) continue; } if (connect(fd, (struct sockaddr*)&ns->dgram->conn.addr.to, get_addr_len(&ns->dgram->conn.addr.to)) == -1) { - ha_warning("resolvers '%s': can't connect socket for nameserver '%s'.\n", - resolvers->id, ns->id); + if (!resolvers->conf.implicit) { /* emit a warning only if it was configured manually */ + ha_warning("resolvers '%s': can't connect socket for nameserver '%s'.\n", + resolvers->id, ns->id); + } close(fd); err_code |= ERR_WARN; continue; @@ -3682,6 +3684,9 @@ int resolvers_create_default() err_code |= resolvers_new(&curr_resolvers, "default", "", 0); if (err_code & ERR_CODE) goto err; + + curr_resolvers->conf.implicit = 1; + err_code |= parse_resolve_conf(NULL, NULL); if (err_code & ERR_CODE) goto err;