× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Do you have java on the box? I just put dnsjava on my box and tried this
and it worked in qsh. www.dnsjava.org

java -cp dnsjava-2.1.7.jar dig @8.8.4.4 medtronsoftware.com
; java dig 0.0
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64220
;; flags: qr rd ra ; qd: 1 an: 1 au: 0 ad: 0
;; QUESTIONS:
;; medtronsoftware.com., type = A, class = IN

;; ANSWERS:
medtronsoftware.com. 3599 IN A 75.131.68.42

;; AUTHORITY RECORDS:

;; ADDITIONAL RECORDS:

;; Message size: 53 bytes
;; Query time: 782 ms




Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Rob Berendt
Sent: Thursday, December 22, 2016 3:23 PM
To: Midrange Systems Technical Discussion
Subject: RE: How to do a dns lookup on a system without

And, FYI, Scott's example did include something where he says that
gethostbyname can return multiple IP addresses and how to process that
with a DO loop.
In our situation 'fecal matter occurs' and we actually had this issue.
One of the reasons we need to look at this carefully. So when he says
"however, it's very unusual to need to work with anything but the first
address in the list" he doesn't have our buddy Murphy working with him.


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Rob Berendt <rob@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 12/22/2016 04:15 PM
Subject: RE: How to do a dns lookup on a system without
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



That's a good question.
Now I remember why I prefer NSLOOKUP to PING. NSLOOKUP has the
DMNNAMSVR
parameter. The problem with using PING is that PING may not refresh in
the time needed. Let me detail this for you...

We're doing a HA switch.
As part of the switch we do this long convoluted process from IBM i to
automatically change our DNS from our primary IP address to our backup
IP
address.
This process has IBM i talking to one pc, which must be signed on as a
particular user. This pc then talks to our DNS and updates the DNS. We

used to talk to the DNS server directly but a Windows server upgrade
slapped the cones of silence on it and killed IBM i from being able to
run

remote commands on it.

What I am trying to do is to have a test process in place to ensure the
communication works by changing a dummy name from one IP address to
another and nslookup the name, from that server, and get the IP address
and ensure that the switch worked.

If I use nslookup and specify the dns server it will get the current IP
address. If I try PING I have to flush the DNS cache a few times,
sacrifice an unblemished ram and maybe it will return the newest IP
address. Flushing the cache involves the manual process of CFGTCP, 12.
Change TCP/IP domain information and entering through that.

Now that I study this gethostbyname doesn't allow me to specify the
domain

name server so it may not be any better than ping.
That's the long way of saying, damn it, you're right!


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.