         [ [ parse-rr ] replicate ] change-additional-section
     ] with-byte-reader ;
 
+ERROR: unsupported-domain-name string ;
+
 : >n/label ( string -- byte-array )
-    [ length 1array ] [ utf8 encode ] bi B{ } append-as ;
-
-: >name ( domain -- byte-array ) "." split [ >n/label ] map concat ;
+    dup [ ascii? ] all?
+    [ unsupported-domain-name ] unless
+    [ length 1array ] [ ] bi B{ } append-as ;
+
+: >name ( domain -- byte-array )
+    "." split [ >n/label ] map concat ;
 
 : query>byte-array ( query -- byte-array )
     [

io.encodings.utf8 io.sockets io.sockets.private
io.streams.byte-array io.timeouts kernel make math math.bitwise
math.parser namespaces nested-comments random sequences
slots.syntax splitting system vectors vocabs.loader strings ;
IN: dns

: with-input-seek ( n seek-type quot -- )


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

