def _gethostbyname(self, hostname):
if self._databaseType in const.IPV6_EDITIONS:<EOL><INDENT>response = socket.getaddrinfo(hostname, <NUM_LIT:0>, socket.AF_INET6)<EOL>family, socktype, proto, canonname, sockaddr = response[<NUM_LIT:0>]<EOL>address, port, flow, scope = sockaddr<EOL>return address<EOL><DEDENT>else:<EOL><INDENT>return socket.gethostbyname(hostname)<EOL><DEDENT>
Hostname lookup method, supports both IPv4 and IPv6.