z/os communications server: z/os resolver

28
© 2014 IBM Corporation ® 1 zOS Communications Server New Hire Education Series zOS Resolver Howie Odishoo zOS Communications Server

Upload: zoscommserver

Post on 11-Jun-2015

1.521 views

Category:

Software


5 download

DESCRIPTION

This presentation discusses the z/OS resolver provided with z/OS Communications Server. Topics discussed include: - Resolver introduction - Resolver address space - Controlling the resolver - Resolver customization - Resolver APIs

TRANSCRIPT

Page 1: z/OS Communications Server: z/OS Resolver

© 2014 IBM Corporation

®

1

zOS Communications Server New Hire Education SerieszOS ResolverHowie Odishoo zOS Communications Server

Page 2: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 2

Agenda

●. Resolver Introduction●. Resolver Address space●. Controlling the Resolver●. Resolver Customization●. Resolver APIs●. Putting it all together●. Reference material●. Question & Answer

Page 3: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 3

➢The resolver acts on behalf of programs to perform the following functions:

- Access name servers to provide name-to-address or address-to-name resolution - Allocate and read the TCPIP.DATA or /etc/resolv.conf file - Establish TCP/IP stack affinity for certain socket APIs - Provide protocol and services information

➢To complete the query for the requesting program, the resolver obtains information from the following sources:

- Available Domain Name Servers (DNSs) - The DNS response information that has been cached locally (when system-wide caching is enabled) - Local definitions, such as /etc/hosts, /etc/ipnodes, HOSTS.SITEINFO, HOSTS.ADDRINFO, and ETC.IPNODES

➢The TCPIP.DATA or /etc/resolv.conf statements control how (and if) the resolver uses name servers.

- The resolver uses the applicable GLOBALTCPIPDATA or DEFAULTTCPIPDATA specification, or the native MVS or z/OS UNIX search order to find TCPIP.DATA or /etc/resolv.conf statements.

Resolver Introduction

Page 4: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 4

The Resolver is used to ........

Communicate with Domain Name Servers (DNSs)DNSs contain information about hosts on a domain basis (e.g., ibm.com)

Names including aliasesdbd5k063.rtp.raleigh.ibm.com a.k.a. buzz

IP addresses assigned to HostnamesCanonical or CNAMEs (alias for another domain name) TTL (Time to live) values Other information – Mail Exchange points (MX records)

Improve usability to end usersNames more useable than IP address

www.ibm.com vs. 129.42.60.216 www.xyz.com vs. 50c9:c2d4:0:1:9:42:105:195

Page 5: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 5

The Resolver provides the following basic services.....

Name resolutionName provided - IP address returnedCommand input – for example: ping meatball.tcp.raleigh.ibm.com telnet ralvs6 ftp ralvms

Reverse Name resolutionIP address provided – name returnedCommand results - traceroute ralvms

cisco4bgb4.tcp.raleigh.ibm.com (9.42.105.129)cisco4afe.tcp.raleigh.ibm.com (9.42.105.65)

E-mail ResolutionSMTP/CSSMTP/sendmail - To: [email protected]

us.ibm.com. 9265 IN MX 10 d01av02.pok.ibm.com. d01av01.pok.ibm.com. 9376 IN A 9.56.224.215

Page 6: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 6

What the Resolver does in a nutshell........

Provides Application Programming Interfaces (APIs)Multiple languages – C/C++, Assembler, REXX

GetHostByName/GetAddrInfo - Name-> IPaddrGetHostByAddr/GetNameInfo - IPaddr -> Nameres_xxxx - direct DNS communication – C/C++ only

Form and Send DNS queriesRFC based – 1034 and 1035

Process DNS responses

Cache results of Positive and Negative responses (optional)

Monitors non-responsive DNSs

Use optional local host tables Hostname unknown to DNSsTest hostname change before DNS update

Page 7: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 7

The Resolver address space first needs to be startedbefore any productive TCP/IP or application work can be done!

Resolver Address Space

Page 8: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 8

TCP/IP will not start until the resolver address space is active *EZZ9315E TCP/IP WAITING FOR RESOLVER TO INITIALIZE

Default behavior OK then nothing to customize Native Search order will be used to find resolver configuration files TCPIP.DATA, /etc/resolv.conf, etc.

more about this to come......

Resolver Customization steps Create Start Procedure Customize via //SETUP DD statements Proc's userid needs access to SETUP file

OMVS segmentAdd RESOLVER_PROC(procname) to BPXPRMxx OMVS will start it - STRONGLY RECOMMENDED

TCP/IP will not start until the resolver address space is active *EZZ9315E TCP/IP WAITING FOR RESOLVER TO INITIALIZE

Default behavior OK then nothing to customize Native Search order will be used to find resolver configuration files TCPIP.DATA, /etc/resolv.conf, etc.

more about this to come......

Resolver Customization steps Create Start Procedure Customize via //SETUP DD statements Proc's userid needs access to SETUP file

OMVS segmentAdd RESOLVER_PROC(procname) to BPXPRMxx OMVS will start it - STRONGLY RECOMMENDED

Preparing to start the Resolver........

Page 9: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 9

Starting the Resolver Address Space........

There are two ways that the resolver can be started:

➢ Use z/OS UNIX System Services to start the resolver

The resolver is started when z/OS UNIX (OMVS) is initialized. This method of starting the resolver ensures that applications that require resolver services are not started before the resolver starts. If you use z/OS UNIX to start the resolver, you can use the default resolver settings, or you can optionally create a start procedure and customize the address space.

RESOLVER_PROC statement in BPXPRMxx SYS1.PARMLIB member * highly recommended

➢ Use automation tools to start the resolver or manually via start command

The resolver is started by issuing the MVS START operator command. You must customize the resolver to use this starting method.

Page 10: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 10

RESOLVER_PROC()

>>___________________________________________________>< | | |_RESOLVER_PROC(___procname__)__| |__NONE_____| |__DEFAULT__|

procname The PROCLIB member to be used to start the resolver.

NONE Specify this if the resolver is not to be automatically started. This is not recommended for installations that use AF_INET transport providers.

DEFAULT Specify this if the resolver is to be started without a PROCLIB member. This is identical to not specifying the RESOLVER_PROC statement. ZOS Unix starts a resolver address space that has the assigned name RESOLVER.

RESOLVER_PROC()

>>___________________________________________________>< | | |_RESOLVER_PROC(___procname__)__| |__NONE_____| |__DEFAULT__|

procname The PROCLIB member to be used to start the resolver.

NONE Specify this if the resolver is not to be automatically started. This is not recommended for installations that use AF_INET transport providers.

DEFAULT Specify this if the resolver is to be started without a PROCLIB member. This is identical to not specifying the RESOLVER_PROC statement. ZOS Unix starts a resolver address space that has the assigned name RESOLVER.

Starting the Resolver during OMVS initialization by updating SYS1.PARMLIB member BPXPRMxx ........

Page 11: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 11

//RESOLVER PROC PARMS='CTRACE(CTIRES00)'//* //EZBREINI EXEC PGM=EZBREINI,REGION=0M,TIME=1440,PARM=&PARMS //* //* SETUP contains Resolver setup parameters. //* See the chapter on "Understanding Resolvers" in//* the IP Configuration Guide for more information. A sample of //* Resolver setup parameters is included in member RESSETUP //* of the SEZAINST data set. //* //SETUP DD DSN=TCPIP.TCPPARMS(SETUPRES),DISP=SHR,FREE=CLOSE //*SETUP DD DSN=TCPIP.SETUP.RESOLVER,DISP=SHR,FREE=CLOSE //*SETUP DD PATH='/etc/setup.resolver',PATHOPTS=(ORDONLY)

//RESOLVER PROC PARMS='CTRACE(CTIRES00)'//* //EZBREINI EXEC PGM=EZBREINI,REGION=0M,TIME=1440,PARM=&PARMS //* //* SETUP contains Resolver setup parameters. //* See the chapter on "Understanding Resolvers" in//* the IP Configuration Guide for more information. A sample of //* Resolver setup parameters is included in member RESSETUP //* of the SEZAINST data set. //* //SETUP DD DSN=TCPIP.TCPPARMS(SETUPRES),DISP=SHR,FREE=CLOSE //*SETUP DD DSN=TCPIP.SETUP.RESOLVER,DISP=SHR,FREE=CLOSE //*SETUP DD PATH='/etc/setup.resolver',PATHOPTS=(ORDONLY)

Sample Resolver Proc........

Page 12: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 12

Controlling the Resolver Changing - Modify (F procname,REFRESH[,SETUP=dsname/HFS])

REFRESH - for long running appls reprocesses current TCPIP.DATA statements on next resolver API usage

SETUP= - change the SETUP statements plus REFRESH

Display setup names - F procname,DISPLAYf resolver,display

EZZ9298I DEFAULTTCPIPDATA - USER1.OUR.DEFAULT.TCPDATA

EZZ9298I GLOBALTCPIPDATA - /etc/TRDP3461_resolv.conf

EZZ9298I DEFAULTIPNODES - SYS1.TCPPARMS(IPNODES)

EZZ9298I GLOBALIPNODES - /etc/ipnodes

EZZ9304I COMMONSEARCH

EZZ9304I CACHE

EZZ9298I CACHESIZE - 200M

EZZ9298I MAXTTL - 600

EZZ9293I DISPLAY COMMAND PROCESSED

Cache management

Modify (F procname,FLUSH,ALL)Display (Netstat RESC/-q)

Stop/Start Stop (P procname) Start (S procname)

Normally only used if installing Resolver maintenance

Changing - Modify (F procname,REFRESH[,SETUP=dsname/HFS])REFRESH - for long running appls reprocesses current TCPIP.DATA statements on next resolver API

usageSETUP= - change the SETUP statements plus REFRESH

Display setup names - F procname,DISPLAYf resolver,display

EZZ9298I DEFAULTTCPIPDATA - USER1.OUR.DEFAULT.TCPDATA

EZZ9298I GLOBALTCPIPDATA - /etc/TRDP3461_resolv.conf

EZZ9298I DEFAULTIPNODES - SYS1.TCPPARMS(IPNODES)

EZZ9298I GLOBALIPNODES - /etc/ipnodes

EZZ9304I COMMONSEARCH

EZZ9304I CACHE

EZZ9298I CACHESIZE - 200M

EZZ9298I MAXTTL - 600

EZZ9293I DISPLAY COMMAND PROCESSED

Cache management

Modify (F procname,FLUSH,ALL)Display (Netstat RESC/-q)

Stop/Start Stop (P procname) Start (S procname)

Normally only used if installing Resolver maintenance

Page 13: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 13

TCPIP.DATA Statement RefreshableDomainOrigin or Domain YES

NSInterAddr or NameServer YES

NSPortAddr YES

ResolveVia YES

ResolverTimeOut YES

ResolverUDPRetries YES

Search YES

Lookup YES

NOCACHE YES

SortList YES

Trace Resolver YES

Options Debug YES

Options Ndots YES

Refreshable TCPIP.DATA statementsRefreshable TCPIP.DATA statements

What statements can be refreshed.......

Page 14: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 14

Definition statementsResolver Setup Statements

Files to use (GLOBALTCPIPDATA/DEFAULTTCPIPDATA)Local Host Table search mechanism (GLOBALIPNODES/DEFAULTIPNODES/COMMONSEARCH)Cache related information (CACHE/NOCAHE/CACHESIZE/MAXTTL)

Unresponsive DNS thresholds (UNRESPONSIVETHRESHOLD)

Resolver Configuration files TCPIP.DATA or /etc/resolv.confDNSs to use (NSINTERADDR or NAMESERVER)How long to wait for a DNS response (RESOLVERTIMEOUT)How many times to try them (RESOLVERUDPRETRIES)Domain names to use (DOMAINORIGIN)

For example raleigh.ibm.com or ibm.comPlus many others!

Local host tables HOSTS.LOCAL, /etc/hosts or IPNodes file Name and IP addresses only

IPv4 and IPv6 supported

IP Configuration Reference has full details and syntax rules

Resolver Customization

Page 15: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 15

; The following statement defines the final search location for ; TCPIP.DATA statements. It will replace TCPIP.TCPIP.DATA ; It may be an MVS data set or HFS file. ; DEFAULTTCPIPDATA('TCPIP.TCPIP.DATA') ; # The following statement defines the first search location for # TCPIP.DATA statements. It may be an MVS data set or HFS file.; ; Update with the correct data set or HFS file name ; GLOBALTCPIPDATA('TCPCS.SYS.TCPPARMS(GLOBAL)') ; GLOBALTCPIPDATA(/etc/tcpipglobal.data) ; # The following statement defines the first search location for # IPNODES statements. It may be an MVS data set or HFS file. ; ; Update with the correct data set or HFS file name ; ; GLOBALIPNODES('TCPCS.SYS.TCPPARMS(IPNODES)') ; GLOBALIPNODES('TCPCS.ETC.IPNODES') GLOBALIPNODES(/etc/ipnodes) ;

; The following statement defines the final search location for ; TCPIP.DATA statements. It will replace TCPIP.TCPIP.DATA ; It may be an MVS data set or HFS file. ; DEFAULTTCPIPDATA('TCPIP.TCPIP.DATA') ; # The following statement defines the first search location for # TCPIP.DATA statements. It may be an MVS data set or HFS file.; ; Update with the correct data set or HFS file name ; GLOBALTCPIPDATA('TCPCS.SYS.TCPPARMS(GLOBAL)') ; GLOBALTCPIPDATA(/etc/tcpipglobal.data) ; # The following statement defines the first search location for # IPNODES statements. It may be an MVS data set or HFS file. ; ; Update with the correct data set or HFS file name ; ; GLOBALIPNODES('TCPCS.SYS.TCPPARMS(IPNODES)') ; GLOBALIPNODES('TCPCS.ETC.IPNODES') GLOBALIPNODES(/etc/ipnodes) ;

Sample Resolver Setup File......

Page 16: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 16

COMMONSEARCH/NOCOMMONSEARCHCACHE/NoCACHECACHESIZE(200M)MAXTTL(2147483647)UNRESPONSIVETHRESHOLD

GLOBALTCPIPDATA DEFAULTTCPIPDATA GLOBALIPNODES DEFAULTIPNODES

Fully qualified MVS data set name The complete name of the MVS data set. The beginning and ending quotes are required. The data set name is not case sensitive. Data set characteristics must be Fixed(F) or Fixed Block(FB) with LRECL 80 to 256. Sequential or member of PDS allowed.

ex: GLOBALTCPIPDATA('TCPCS.SYS.TCPPARMS(GLOBAL)')

HFS file absolute pathname The complete name of the HFS file. The beginning slash is required. The HFS path name is case sensitive. Maximum HFS line length is 256.

ex: GLOBALIPNODES(/etc/ipnodes)

COMMONSEARCH/NOCOMMONSEARCHCACHE/NoCACHECACHESIZE(200M)MAXTTL(2147483647)UNRESPONSIVETHRESHOLD

GLOBALTCPIPDATA DEFAULTTCPIPDATA GLOBALIPNODES DEFAULTIPNODES

Fully qualified MVS data set name The complete name of the MVS data set. The beginning and ending quotes are required. The data set name is not case sensitive. Data set characteristics must be Fixed(F) or Fixed Block(FB) with LRECL 80 to 256. Sequential or member of PDS allowed.

ex: GLOBALTCPIPDATA('TCPCS.SYS.TCPPARMS(GLOBAL)')

HFS file absolute pathname The complete name of the HFS file. The beginning slash is required. The HFS path name is case sensitive. Maximum HFS line length is 256.

ex: GLOBALIPNODES(/etc/ipnodes)

Resolver Setup statements.......

IP Configuration Reference has details and syntax rules

Page 17: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 17

➢ Each address Space/Userid has their own TCPIP.DATA

● Determined by the API the application uses

➔ Native MVS TCP/IP C Sockets - Ipv4 Only TCP/IP Pascal Sockets - Ipv4 Only TCP/IP REXX Sockets TCP/IP Sockets Extended (EZASMI or EZASOKET)

➔ z/OS UNIX XL (Language Environment) C/C++ Sockets z/OS Unix System Services Callable (BPX*)

TCPIP.DATA aka /etc/resolv.conf.......

Page 18: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 18

How the resolver finds a TCPIP.DATA file for an application....

GLOBALTCPIPDATA allows an installation to enforce a single resolver configuration for the entire LPAR fully under the administrator's control. In most cases, the need for individual user-specific resolver configurations is eliminated when using GLOBALTCPIPDATA, however like anything there are exceptions! Note: If the GLOBALTCPIPDATA and/or DEFAULTTCPIPDATA are not specified in the system resolver setup file, the corresponding steps in the above search orders are ignored.

Native MVS sockets programs:1.GLOBALTCPIPDATA2.//SYSTCPD DD statement3.userID/jobname.TCPIP.DATA4.SYS1.TCPPARMS(TCPDATA)5.DEFAULTTCPIPDATA6.TCPIP.TCPIP.DATA

LE C/C++ sockets programs:1.GLOBALTCPIPDATA2.RESOLVER_CONFIG

environment variable3./etc/resolv.conf4.//SYSTCPD DD statement5.userID.TCPIP.DATA6.SYS1.TCPPARMS(TCPDATA)7.DEFAULTTCPIPDATA8.TCPIP.TCPIP.DATA

//RESOLVER PROC PARMS='CTRACE(CTIRES00)' //EZBREINI EXEC PGM=EZBREINI,REGION=0M,TIME=1440,PARM=&PARMS //SETUP DD DSN=USER1.TCPCS.TCPPARMS(RSSETUP),DISP=SHR,FREE=CLOSE

DEFAULTTCPIPDATA('USER1.TCPCS.TCPPARMS(DEFAULT)') GLOBALTCPIPDATA('USER1.TCPCS.TCPPARMS(GLOBAL)')

USS callable sockets programs:1.GLOBALTCPIPDATA2./etc/resolv.conf3.//SYSTCPD DD statement4.userID.TCPIP.DATA5.SYS1.TCPPARMS(TCPDATA)6.DEFAULTTCPIPDATA7.TCPIP.TCPIP.DATA

Page 19: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 19

z/OS UNIX – LE C/C++ and z/OS UNIX Callable application

GLOBALTCPIPDATAIf defined, the setup statement value is used.

The search continues for an additional configuration file. The search ends with the next file found.

● The environment variable RESOLVER_CONFIG - For LE API only● /etc/resolv.conf● //SYSTCPD DD card ● userid.TCPIP.DATA● SYS1.TCPPARMS(TCPDATA)● DEFAULTTCPIPDATA

If defined, the setup statement value is used.● TCPIP.TCPIP.DATA

Note: TCP/IP Stack uses this search order for its TCPIP.DATA HOSTNAME value!!

z/OS UNIX – LE C/C++ and z/OS UNIX Callable application

GLOBALTCPIPDATAIf defined, the setup statement value is used.

The search continues for an additional configuration file. The search ends with the next file found.

● The environment variable RESOLVER_CONFIG - For LE API only● /etc/resolv.conf● //SYSTCPD DD card ● userid.TCPIP.DATA● SYS1.TCPPARMS(TCPDATA)● DEFAULTTCPIPDATA

If defined, the setup statement value is used.● TCPIP.TCPIP.DATA

Note: TCP/IP Stack uses this search order for its TCPIP.DATA HOSTNAME value!!

TCPIP.DATA search order.......

Page 20: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 20

Native MVS applications– All TCP/IP provided APIs

GLOBALTCPIPDATAIf defined, the setup statement value is used.

The search continues for an additional configuration file. The search ends with the next file found.

● //SYSTCPD DD card ● userid/jobname.TCPIP.DATA

userid is the user ID that is associated with the current security environment (address space or task).

jobname is the name specified on the JOB JCL statement for batch jobs or the procedure name for a started procedure.

● SYS1.TCPPARMS(TCPDATA)● DEFAULTTCPIPDATA

If defined, the setup statement value is used.● TCPIP.TCPIP.DATA

Native MVS applications– All TCP/IP provided APIs

GLOBALTCPIPDATAIf defined, the setup statement value is used.

The search continues for an additional configuration file. The search ends with the next file found.

● //SYSTCPD DD card ● userid/jobname.TCPIP.DATA

userid is the user ID that is associated with the current security environment (address space or task).

jobname is the name specified on the JOB JCL statement for batch jobs or the procedure name for a started procedure.

● SYS1.TCPPARMS(TCPDATA)● DEFAULTTCPIPDATA

If defined, the setup statement value is used.● TCPIP.TCPIP.DATA

TCPIP.DATA search order.......

Page 21: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 21

Merging parameters from GLOBALTCPIPDATA and a locally assigned resolver configuration file

If a GLOBALTCPIPDATA file is used, these statements must be coded or defaults will be used by the system resolver

Domain or DomainOriginNameServer or NSInterAddrNSPortAddrResolverTimeOutResolverUDPRetriesResolveViaSearchSortlist

These statements may be used in the GLOBALTCPIPDATA file, but can be located in other resolver configuration files, according to the usual search orders.If they are coded in GLOBALTCPIPDATA, then the values in GLOBALTCPIPDATA take precedence over any values specified in local resolver configuration files.

HostNameTCPIPJobNameDataSetPrefixMessageCaseSockDebugSockNoTestStorTrace ResolverTrace SocketAlwaysWTOOptionsLookUp NoCache

You should be careful placing some of these options in GLOBALTCPIPDATA – Trace Resolver wouldn't be a good idea to enable on a system-wide level!

Page 22: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 22

Resolver APIs...

Gethostbyname and Gethostbyaddr provide● name-to-address and address-to-name resolution● Only IPv4

Information returned in HOSTENT structure - EZBREHST● Contains canonical name (e.g, vmsdvm4.pok.ibm.com) aka CNAME● Contains alias names (e.g., ralvms.raleigh.ibm.com)● Up to 35 IP addresses

Gethostbyname and Gethostbyaddr provide● name-to-address and address-to-name resolution● Only IPv4

Information returned in HOSTENT structure - EZBREHST● Contains canonical name (e.g, vmsdvm4.pok.ibm.com) aka CNAME● Contains alias names (e.g., ralvms.raleigh.ibm.com)● Up to 35 IP addresses

Page 23: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 23

Resolver APIs...

Getaddrinfo and Getnameinfo provide● name-to-address and address-to-name resolution● IPv4 and IPv6 supported● Many parameters and flags● Can also provide service information● usually from /etc/services● service name to port number/protocol● Port number/protocol to name

Getaddrinfo returns ADDRINFO structure - EZBREHST● multiple chained addrinfos can be returned● ADDRINFO structure can be used by application● Up to 35 IP addresses/sockaddr structures● Canonical name can be requested● application must do Freeaddrinfo call

Getaddrinfo and Getnameinfo provide● name-to-address and address-to-name resolution● IPv4 and IPv6 supported● Many parameters and flags● Can also provide service information● usually from /etc/services● service name to port number/protocol● Port number/protocol to name

Getaddrinfo returns ADDRINFO structure - EZBREHST● multiple chained addrinfos can be returned● ADDRINFO structure can be used by application● Up to 35 IP addresses/sockaddr structures● Canonical name can be requested● application must do Freeaddrinfo call

Page 24: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 24

ftp 10.1.1.1 ftp hostxftp hostx

Hardcoded IP Addresses Local hosts file Domain Name System

Resolver TechnologyUsed

None - use the entered IP address directly on the connect() or sendto() socket call

Use resolver calls and let the resolver find an IP address in the locally configured hosts file (/etc/hosts, /etc/ipnodes or hlq.HOSTS.ADDR/SITEINFO)

Use resolver calls and let the resolver contact the configured name server for an IP address

Benefit

* Fast (no name resolution)* Good in some debugging

situations (you know exactly which IP address is being used)

Fast (local name resolution)

* Renumbering can be done without any local changes

* All host names (in the entire Internet) can be resolved

* A hierarchical name space

Drawback

* Difficult to remember IP addresses

* VERY inconvenient in case a network renumbering is necessary.

* Almost Impossible with IPv6 addresses

* If renumbering is needed, all the local hosts files have to be updated

* Only locally configured host names can be resolved

* A flat name space

Potential for extra network flows to resolve hostname before destination can be reached. Caching eliminates this after the first request

Putting it all together...

Page 25: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 25

Putting it all together...Typical scenario.......

Enter: ftp hostx <CR>

----gethostbyname(hostx)--connect(192.168.1.1)--

ftp client programTCPIP.DATA or /etc/resolv.conf --

DomainOrigin abc.comNSInterAddr 10.1.1.1--

Resolver routines

1.Get resolver info2.Look into local

hosts file or3.send UDP query4.receive UDP reply5.return IP address

Name server

Give me the IP address forhostx.abc.com

IP address is 192.168.1.1

Find an IP address that matches the requested name!

Name server host at 10.1.1.1

The TCPIP.DATA statement LOOKUP controls if DNS or LOCAL files are used and in what order, or if either method is used or not.If there is no name server IP address in the resolver configuration file, the resolver will o look for a local hosts file for locally administered host names and IP addressesThe resolver usually uses UDP to communicate with a name server.

UDP - port 53

Local HOSTS file

Page 26: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 26

Page 27: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 27

IBM z/OS V2R1 Communications Server TCP/IP implementation guide vol#1 (Chapter 2)http://publib-b.boulder.ibm.com/abstracts/sg248096.html?Open

IBM z/OS V2R1 Communications Server: IP Configuration Guidehttp://pic.dhe.ibm.com/infocenter/zos/v2r1/index.jsp?topic=%2Fcom.ibm.zos.v2r1.halz002%2Ftoc.htm

IBM z/OS V2R1 Communications Server: IP Configuration referencehttp://pic.dhe.ibm.com/infocenter/zos/v2r1/index.jsp?topic=%2Fcom.ibm.zos.v2r1.halz001%2Ftoc.htm

IBM z/OS V2R1 Communications Server: IP Sockets Application Programming Interface Guide and Reference http://pic.dhe.ibm.com/infocenter/zos/v2r1/index.jsp?topic=%2Fcom.ibm.zos.v2r1.hala001%2Ftoc.htm

IBM z/OS V2R1 UNIX System Services Programming: Assembler Callable Services Reference http://pic.dhe.ibm.com/infocenter/zos/v2r1/index.jsp?topic=%2Fcom.ibm.zos.v2r1.bpxb100%2Ftoc.htm

IBM z/OS V2R1 MVS Initialization and Tuning Reference http://pic.dhe.ibm.com/infocenter/zos/v2r1/index.jsp?topic=%2Fcom.ibm.zos.v2r1.ieae200%2Ftoc.htm

Technotes:

Customizing the z/OS RESOLVERhttp://www-01.ibm.com/support/docview.wss?uid=swg21066874

Understanding how the z/OS Communications Server IP resolver queries DNS for a host name to IP address resolutionhttp://www-01.ibm.com/support/docview.wss?uid=swg21115689

Collecting Trace Resolver Outputhttp://www-01.ibm.com/support/docview.wss?uid=isg1II13398

Using the Resolver CTRACE when conventional traces do not workhttp://www-01.ibm.com/support/docview.wss?uid=swg21248724

Reference Material

Page 28: z/OS Communications Server: z/OS Resolver

IBM Software Group | Enterprise Networking Solutions

© 2014 IBM Corporation 28

Question & Answer