Comments (5)
Basic resolving code works with containers set up using 'docker compose', but it does not when the containers run in a 'k8s' setup.
Example code:
<?php
declare (strict_types = 1);
use \Amp\Loop;
use \Amp\Dns\Record;
require __DIR__ . '/vendor/autoload.php';
sleep(5);
Loop::run(function () {
$records = yield \Amp\Dns\resolve('eventstore', Record::A);
var_dump($records);
});
The error generated is the following:
Fatal error: Uncaught Amp\Dns\NoRecordException: No records returned for 'eventstore' (DNAME) in /app/vendor/amphp/dns/lib/Rfc1035StubResolver.php:317
Stack trace:
#0 [internal function]: Amp\Dns\Rfc1035StubResolver->Amp\Dns\{closure}()
#1 /app/vendor/amphp/amp/lib/Coroutine.php(76): Generator->send(Object(LibDNS\Messages\Message))
#2 /app/vendor/amphp/amp/lib/Internal/Placeholder.php(130): Amp\Coroutine->Amp\{closure}(NULL, Object(LibDNS\Messages\Message))
#3 /app/vendor/amphp/amp/lib/Coroutine.php(81): Amp\Coroutine->resolve(Object(LibDNS\Messages\Message))
#4 /app/vendor/amphp/amp/lib/Internal/Placeholder.php(43): Amp\Coroutine->Amp\{closure}(NULL, Object(LibDNS\Messages\Message))
#5 /app/vendor/amphp/amp/lib/Internal/PrivatePromise.php(23): class@anonymous->onResolve(Object(Closure))
#6 /app/vendor/amphp/amp/lib/Internal/Placeholder.php(125): Amp\Internal\PrivatePromise->onResolve(Object(Closure))
#7 /app/vendor/amphp/amp/lib/Deferred.php(45): class@anonymous->resolve(Object(Amp\Internal\PrivatePromise))
#8 /app/vendo in /app/vendor/amphp/dns/lib/Rfc1035StubResolver.php on line 317
Attached an archive used to verify the bug using 'minikube' (locally) and 'kops' (AWS).
DNSTest.zip
from dns.
An additional piece of info, the content of the 'resolve.conf' file on the AWS setup:
nameserver 100.64.0.10
search default.svc.cluster.local svc.cluster.local cluster.local eu-west-2.compute.internal
options ndots:5
from dns.
I guess the DNS is resolved via the search
configuration? In that case, try eventstore.default.svc.cluster.local
etc. and see whether that works.
from dns.
Your suggestion seems to works correctly. Thank you very much.
from dns.
If you want direct support, please add a 👍 to #47.
from dns.
Related Issues (20)
- Too many time to resolve localhost domain HOT 7
- getting could not load the system's DNS configuration, using synchronous, blocking fallback error HOT 9
- Incomplete packet error (still exists) HOT 1
- Could Not Resolve Host HOT 3
- Backport queue errors on closure
- Rename Record and Resolver as well?
- Amp\Dns\resolve misses optional Cancellation parameter
- Async example? HOT 1
- Resolution where NDots > 1 failing
- Remove amphp/file dependency
- Bump the minimum version of amphp/uri HOT 4
- Subtype 'Too many redirects' DnsException HOT 1
- CreateProcess failed, error 193 HOT 6
- Libdns bug HOT 5
- Are dotless domains valid? HOT 3
- DNS frequently fails on Windows HOT 3
- Incomplete packet error HOT 4
- etc/resolve ndots set to 1 HOT 1
- Ignore ServFail / NxDomain for search list, e.g. in Kubernetes cluster HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dns.