Is there something broken with DNS on Yosemite (and earlier OS versions) when running a daemon?
Is there something broken with DNS on Yosemite (and earlier OS versions) when running a daemon?
- Subject: Is there something broken with DNS on Yosemite (and earlier OS versions) when running a daemon?
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 07 Jan 2015 16:38:48 +0000
- Thread-topic: Is there something broken with DNS on Yosemite (and earlier OS versions) when running a daemon?
Problem:
--------
I have a launchd daemon that performs DNS requests using getaddrinfo to retrieve the IP(s) for a series of hosts' names.
• On Yosemite:
The requests all fail (EAI_NONAME) when they are run just after the daemon has been launched. They also fail 1 minute later. They again fail 1 minute later. And they again fail 1 minute later.
Killing the process via Activity Monitor (*) automatically restarts the daemon as expected.
And then the requests that should succeed do succeed on the first attempt.
Also if you were to perform a nslookup (from the Terminal) query during that time with the same hosts' names, it would work fine.
• On Mountain Lion:
The requests that should succeed do succeed. At least on the computer I used.
Discussion:
-----------
I could understand that just after boot time the DNS APIs would not be ready. I can not understand why they still do not work 3 minutes after startup time.
Question:
---------
What could prevent the getaddrinfo from working? Could it be some mach bootstrap context issue?
According to the doc, this API is supposed to be thread safe. A hostname is correctly provided, a hints structure is provided (using NULL does not solve the issue).
(*) I'm wondering whether it's the designed behavior of Activity Monitor that you can force kill a root process without having to enter your admin password.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden