 : message>names ( message -- names )
     answer-section>> [ rdata>> name>> ] map ;
 
+: message>a-names ( message -- names )
+    answer-section>>
+    [ rdata>> ] map [ a? ] filter [ name>> ] map ;
+
 : message>mxs ( message -- assoc )
     answer-section>> [ rdata>> [ preference>> ] [ exchange>> ] bi 2array ] map ;
 


: udp-query ( bytes server -- bytes' )
    f 0 <inet4> <datagram>
    5 seconds over set-timeout [
        [ send ] [ receive drop ] bi
    ] with-disposal ;


    [ dns-A-query a-message. ]
    [ dns-AAAA-query a-message. ]
    [ dns-MX-query mx-message. ] tri ;

! M: string resolve-host dns-A-query message>a-names [ <ipv4> ] map ;
    
HOOK: initial-dns-servers os ( -- seq )

