Previously, I used to have the below code to get workgroup / domain name of the active directory service provider.
SCDynamicStoreRef storeRef = SCDynamicStoreCreate(NULL, (CFStringRef)@"GetWorkgroup", NULL, NULL);
CFPropertyListRef global = SCDynamicStoreCopyValue (storeRef,CFSTR("State:/Network/Global/SMB"));
id workgroup = [(__bridge NSDictionary *)global valueForKey:@"Workgroup"];
On few Macs (probably starting from Sonoma), the workgroup property is not set. What is the alternative to get this information programatically?
System Configuration
RSS for tagSystem Configuration allows applications to access a device’s network configuration settings and determine the reachability of the device.
Posts under System Configuration tag
24 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I am trying to fetch DHCP server identifiers of the current network. For IPv4 I am able to get this information using SCDynamicStoreCopyDHCPInfo and then using DHCPInfoGetOptionData fetching option 54.
I am trying to do the same thing for IPv6, in my scutil I do see DHCPv6 present. Is there any API present which fetches this information for v6 DHCP servers, or do I have to get this direct from scutil?
I am trying to connect to localhost:8081 from simulator, but it is unable to connect with following logs:
info 12:07:49.167248+0530 com.apple.WebKit.Networking nw_resolver_host_resolve_callback [C8.1] flags=0x40000003 ifindex=0 error=NoSuchRecord(-65554) hostname=localhost. addr=IN6ADDR_ANY ttl=60
info 12:07:49.167310+0530 com.apple.WebKit.Networking nw_resolver_host_resolve_callback [C8.1] flags=0x40000002 ifindex=0 error=NoSuchRecord(-65554) hostname=localhost. addr=INADDR_ANY ttl=108002
Macos 14.6.1
iOS simulator version 17.5
Som observations
localhost:8081 does not load on simulator but 0.0.0.0:8081 loads fine, also 127.0.0.0:8081 loads fine on simulator.
My laptop is a managed device with network filter
Switching network sometimes fixes the issue. Restarting laptop sometimes fixes the issue.
localhost:8081 opens find on laptop, but not on simulator.
Contents of my laptop's /etc/hosts:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Hi,
I'm looking for feedback regarding SCNetworkReachability under macOS Sonoma.
It seems that since beta 3 the notifications behaviour changed.
In a LaunchAgent I'm using SCNetworkReachabilityCreateWithName + SCNetworkReachabilitySetCallback + SCNetworkReachabilityScheduleWithRunLoop and wait for callbacks looking at the kSCNetworkReachabilityFlagsReachable flag. This is running fine under macOS 12.x, 13.x and 14.0 for more than a year.
If I log all callback entries I observe unexpected notifications as if the looked host became unreachable for very small amount of time (ms). The host is flagged as unreachable then few ms later reachable again then unreachable again.
Fast switching is fine, I can accept that the service is unreachable even for 1s but the probleme is the latest status do not reflect actual reachability of the service.
This is in a corporate network with the complexity of using a proxy.pac.
Does anybody noticed something similar ?
I filled a Feedback FB13442134 in case it could be a regression of 14.2