[Bug 291444] lang/dotnet: Name resolution via System.Net.Dns doesn't work
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 06 Dec 2025 21:00:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291444
Bug ID: 291444
Summary: lang/dotnet: Name resolution via System.Net.Dns
doesn't work
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: arrowd@FreeBSD.org
Reporter: kevinz5000@gmail.com
Flags: maintainer-feedback?(arrowd@FreeBSD.org)
Assignee: arrowd@FreeBSD.org
I'm using dotnet-9.0.10 from binary pkg on 14.3-RELEASE-p5 amd64.
DNS resolution using System.Net.Dns doesn't appear to work, as evidenced by
this simple test program:
using System.Net;
var entry = Dns.GetHostEntry("localhost");
Console.WriteLine(entry.AddressList);
Running this gives:
System.Net.IPAddress[]
Which is an empty list, i.e. no IP address found. I tried a few common domain
names (in addition to localhost, which is technically from /etc/hosts) but
those don't work either.
You can build such a test program by:
1. $ dotnet new console
2. Add the above program text to Program.cs
3. $ dotnet run
I ran truss on the program produced by `dotnet build`. I've snipped out the
relevant part that I believe is related to name resolution and included it
below:
fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r--
,inode=251,size=260,blksize=4096 },0x0) = 0 (0x0)
fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r--
,inode=251,size=260,blksize=4096 },0x0) = 0 (0x0)
open("/etc/nsswitch.conf",O_RDONLY|O_CLOEXEC,0666) = 47 (0x2f)
fstat(47,{ mode=-rw-r--r-- ,inode=251,size=260,blksize=4096 }) = 0 (0x0)
read(47,"#\n# nsswitch.conf(5) - name ser"...,4096) = 260 (0x104)
read(47,0x405df2825000,4096) = 0 (0x0)
close(47) = 0 (0x0)
open("/etc/hosts",O_RDONLY|O_CLOEXEC,0666) = 47 (0x2f)
fstat(47,{ mode=-rw-r--r-- ,inode=928,size=1327,blksize=4096 }) = 0 (0x0)
read(47,"#\n# Host Database\n#\n# This fi"...,4096) = 1327 (0x52f)
read(47,0x405df2825000,4096) = 0 (0x0)
close(47) = 0 (0x0)
__sysctl("net.inet6.ip6.addrctlpolicy",4,0x0,0x202248adf410,0x0,0) = 0 (0x0)
__sysctl("net.inet6.ip6.addrctlpolicy",4,0x405df290a200,0x202248adf410,0x0,0) =
0 (0x0)
socket(PF_INET6,SOCK_DGRAM|SOCK_CLOEXEC,IPPROTO_UDP) = 47 (0x2f)
connect(47,{ AF_INET6 [::1]:1 },28) = 0 (0x0)
getsockname(47,{ AF_INET6 [::1]:11494 },0x202248adf2bc) = 0 (0x0)
ioctl(47,SIOCGIFAFLAG_IN6,0x202248adf2f0) ERR#6 'Device not configured'
close(47) = 0 (0x0)
socket(PF_INET6,SOCK_DGRAM|SOCK_CLOEXEC,IPPROTO_UDP) = 47 (0x2f)
connect(47,{ AF_INET6 [::1]:1 },28) = 0 (0x0)
getsockname(47,{ AF_INET6 [::1]:43213 },0x202248adf2bc) = 0 (0x0)
ioctl(47,SIOCGIFAFLAG_IN6,0x202248adf2f0) ERR#6 'Device not configured'
close(47) = 0 (0x0)
socket(PF_INET6,SOCK_DGRAM|SOCK_CLOEXEC,IPPROTO_UDP) = 47 (0x2f)
connect(47,{ AF_INET6 [::1]:1 },28) = 0 (0x0)
getsockname(47,{ AF_INET6 [::1]:49059 },0x202248adf2bc) = 0 (0x0)
ioctl(47,SIOCGIFAFLAG_IN6,0x202248adf2f0) ERR#6 'Device not configured'
close(47) = 0 (0x0)
socket(PF_INET,SOCK_DGRAM|SOCK_CLOEXEC,IPPROTO_UDP) = 47 (0x2f)
connect(47,{ AF_INET 127.0.0.1:1 },16) = 0 (0x0)
getsockname(47,{ AF_INET 127.0.0.1:33215 },0x202248adf2bc) = 0 (0x0)
close(47) = 0 (0x0)
socket(PF_INET,SOCK_DGRAM|SOCK_CLOEXEC,IPPROTO_UDP) = 47 (0x2f)
connect(47,{ AF_INET 127.0.0.1:1 },16) = 0 (0x0)
getsockname(47,{ AF_INET 127.0.0.1:60758 },0x202248adf2bc) = 0 (0x0)
close(47) = 0 (0x0)
socket(PF_INET,SOCK_DGRAM|SOCK_CLOEXEC,IPPROTO_UDP) = 47 (0x2f)
connect(47,{ AF_INET 127.0.0.1:1 },16) = 0 (0x0)
getsockname(47,{ AF_INET 127.0.0.1:14370 },0x202248adf2bc) = 0 (0x0)
close(47) = 0 (0x0)
__sysctl("kern.hostname",2,0x202248adf680,0x202248adf608,0x0,0) = 0 (0x0)
--
You are receiving this mail because:
You are the assignee for the bug.