Skip to content

Commit eb9674d

Browse files
exaby73transistive
authored andcommitted
fix: Use gethostbyname() to resolve hosts using /etc/hosts alongside DNS resolving
1 parent b802e51 commit eb9674d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Neo4j/Neo4jConnectionPool.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ public function acquire(SessionConfiguration $config): Generator
123123
$latestError = null;
124124

125125
if ($table == null) {
126-
$addresses = $this->resolver->getAddresses((string) $this->data->getUri());
126+
$addresses = (function () {
127+
yield gethostbyname($this->data->getUri()->getHost());
128+
yield from $this->resolver->getAddresses($this->data->getUri()->getHost());
129+
})();
127130
foreach ($addresses as $address) {
128131
$triedAddresses[] = $address;
129132
$pool = $this->createOrGetPool(Uri::create($address));

0 commit comments

Comments
 (0)