You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Does anyone know of a working DNS query example for PBCC?
I have tried to compile, rework, modify every example posted to no avail.
Anyone have a working example that will compile under PBCC3.0?
If you mean resolving IP addresses to hostnames and viceversa, then HOST NAME and HOST ADDR are the PB functions to use.
Code:
#COMPILE EXE
FUNCTION PBMAIN() AS LONG
'// Resolve a hostname to its IP address
DIM p AS BYTE PTR
HOST ADDR "www.powerbasic.com" TO ip&
p = VARPTR(ip&)
STDOUT USING$("#_.#_.#_.#", @p, @p[1], @p[2], @p[3])
'// Resolve that IP address back to its hostname
HOST NAME ip& TO hostname$
STDOUT hostname$
WAITKEY$
END FUNCTION
What I am looking for through is a way to query a DNS server for a specific record. (IE MX, A name etc)
The MX record is most important to me but I also am interested in most other records as well.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment