Sample Header Ad - 728x90

Is there a daemon which resolves a service name to a port?

2 votes
1 answer
521 views
A DNS server resolves a hostname to an IP address. A program can resolve a hostname to an IP address by calling getaddrinfo() which in turn asks a DNS server to do the resolution, if I am correct. In SysV init, is there some daemon which resolves a service name to a port, just like a DNS server? Does it do that by reading /etc/services? Does getaddrinfo() also invoke the daemon to perform the resolution? I know that inetd reads /etc/services to decide which sockets to listen to. But inetd doesn't seem to resolve service name to port, does it? Thanks.
Asked by Tim (106420 rep)
Feb 14, 2019, 12:48 AM
Last activity: Feb 17, 2019, 01:43 PM