import socket


def ip6_to_bytes(ip):
    """Convert IPv6 string to :py:class:`bytes`

    :param ip: IPv6 in dot-decimal notation
    :type ip: str
    :rtype: bytes
    """
    return socket.inet_pton(socket.AF_INET6, ip)