DNS protocol implementation in Scala