Announcement

Collapse
No announcement yet.

Working DNS Query?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Working DNS Query?

    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?

  • #2
    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
    -

    Comment


    • #3
      Thanks for the reply

      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.

      Comment


      • #4
        If you just do a Topic search for "MX" you'll find several examples, including..
        http://www.powerbasic.com/support/fo...ML/000937.html
        http://www.powerbasic.com/support/fo...ML/002317.html
        http://www.powerbasic.com/support/fo...ML/002318.html
        http://www.powerbasic.com/support/fo...ML/001438.html
        -

        Comment

        Working...
        X