Why is the wrong TCPIP Resolver proc being used?

What is the resolver?

The resolver task provides local mapping for URL names to IP addresses. It means you can provide your own mapping for URLs. You can chose to have mapping go to a Domain Name Server and look up the URL; but I just wanted to control which URLs can be used.

For example

GLOBALTCPIPDATA – /etc/resolv.conf has

nameserver 8.8.8.8 
nameserver 1.1.1.1

GLOBALIPNODES – /etc/hosts has

151.101.128.223        pypi.org    pip 
151.101.192.223 pypi.org pip
151.101.192.223 files.pythonhosted.org pipfiles
20.26.156.215 github.com
151.101.1.91 curl.se
185.199.110.133 raw.githubusercontent.com
185.199.110.133 release-assets.githubusercontent.com
169.63.188.167 downloads.pyaitoolkit.ibm.net

10.1.1.2 STD1.ibm.com
127.0.0.1 localhost

The above are needed for zopen to work.

The started task

There is a started task RESOLVER in SYS1.PROCLIB and in USER.PROCLIB. Although USER.PROCLIB takes precedence over SYS1.PROCLIB, the SYS1.PROCLIB version is started.

It took me an hour or so to work out why.

SYS1.PARMLIB(BPXPRM00)

This member defined the OMVS configuration, such as which file systems to define, and which files systems to mount etc.

I have a parameter RESOLVER_PROC(RESOLVER). The documentation says

  • Specifies how the resolver address space is processed during z/OS UNIX initialization.
  • nnnnn The name of the address space for the resolver and the procedure member name in the appropriate proclib. procname is one to eight characters long. The procedure must reside in a data set that is specified by the MSTJCLxx parmlib member’s IEFPDSI DD card specification.

My MSTJCL00 parmlib member has

//MSTJCL00 JOB  MSGLEVEL=(1,1),TIME=1440                     
// EXEC PGM=IEEMB860,DPRTY=(15,15)
//STCINRDR DD SYSOUT=(A,INTRDR)
//TSOINRDR DD SYSOUT=(A,INTRDR)
//IEFPDSI DD DSN=SYS1.PROCLIB,DISP=SHR
//IEFPARM DD DSN=SYS1.PARMLIB,DISP=SHR
//SYSUADS DD DSN=SYS1.VS01.UADS,
// DISP=SHR
//SYSLBC DD DSN=SYS1.VS01.BRODCAST,
// DISP=SHR

According to the documentation above the RESOLVER_PROC(RESOLVER) will look for member RESOLVER in SYS1.PROCLIB.

Removing the RESOLVER_PROC from my BPXPRM00 did not solve the problem, because there is a default value.

DEFAULT: Causes an address space named RESOLVER to start, using the system default procedure of IEESYSAS. The address space is started with SUB=MSTR so that it runs under the MASTER address space instead of the JES address space.

There is an option RESOLVER_PROC(NONE), but TCPIP startup waits for the resolver – and so your IPL waits until you start the resolver.

The easy fix is easy

Stop and restart the resolver

P RESOLVER
S RESOLVER

A better fix is to update the member in SYS1.PROCLIB, however because on my configuration IBM can refresh SYS1.PROCLIB my changes could be overwritten.

Improving the resolver procedure

When I was looking into the problem I saw that the configuration files used were in /etc/.

When IBM refreshes the z/OS system, it will replace the /etc directories, so it is better not to store my configuration in /etc/. I changed it so the procedure only used my personal datasets.

My resolver JCL is

//* TCPIP RESOLVER - COLINS 
//*
//RESOLVER PROC PARMS=CTRACE(CTIRES00)
//*
//EZBREINI EXEC PGM=EZBREINI,REGION=0M,TIME=1440,
// PARM=('&PARMS',
// 'ENVAR("RESOLVER_TRACE=/var/log/resolver"/')
//SETUP DD DISP=SHR,DSN=COLIN.TCPPARMS(GBLRESOL),FREE=CLOSE
//SYSTCPT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*

The configuration is in COLIN.TCPPARMS(GBLRESOL).

This member now looks like

  DEFAULTTCPIPDATA('COLIN.TCPPARMS(GBLTDATA)') 
GLOBALTCPIPDATA('COLIN.TCPPARMS(RESOLVE)')
# GLOBALTCPIPDATA(/etc/resolv.conf)
;
# -----------------------------------------------------------------
# Default zPDT Linux Base to z/OS Tunnel (Stand-Alone)
# -----------------------------------------------------------------
;
# GLOBALIPNODES(/etc/hosts)
GLOBALIPNODES('COLIN.TCPPARMS(HOSTS)')
....

Where the members COLIN.TCPPARMS(RESOLVE) and COLIN.TCPPARMS(HOSTS) contain the information.

When you start the resolver task you get information like

EZZ9298I RESOLVERSETUP - COLIN.TCPPARMS(GBLRESOL)                 
EZZ9298I DEFAULTTCPIPDATA - COLIN.TCPPARMS(GBLTDATA)
EZZ9298I GLOBALTCPIPDATA - COLIN.TCPPARMS(RESOLVE)
EZZ9298I DEFAULTIPNODES - COLIN.TCPPARMS(ZPDTIPN1)
EZZ9298I GLOBALIPNODES - COLIN.TCPPARMS(HOSTS)
EZZ9304I COMMONSEARCH
EZZ9304I CACHE
EZZ9298I CACHESIZE - 200M
EZZ9298I MAXTTL - 2147483647
EZZ9298I MAXNEGTTL - 2147483647
EZZ9304I NOCACHEREORDER
EZZ9298I UNRESPONSIVETHRESHOLD - 25
EZZ9291I RESOLVER INITIALIZATION COMPLETE

so you can see what configuration is being used.