Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1040053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:10:35+00:00 2026-05-16T15:10:35+00:00

socket.getfqdn() works fine with IPv4 addresses, for example: >>> import socket >>> socket.getfqdn(8.8.8.8) ‘google-public-dns-a.google.com’

  • 0

socket.getfqdn() works fine with IPv4 addresses, for example:

>>> import socket
>>> socket.getfqdn("8.8.8.8")
'google-public-dns-a.google.com'

However, it doesn’t work for IPv6 addresses.

>>> socket.getfqdn("2404:6800:8004::68")
'2404:6800:8004::68'
>>> socket.has_ipv6
True

How can I do this with IPv6? Ideally with only modules in the standard library.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:10:36+00:00Added an answer on May 16, 2026 at 3:10 pm

    Are you sure that ipv6 address has any revers DNS associated with it? dig reports it doesn’t:

    $ dig -x 2404:6800:8004::68
    
    ; <<>> DiG 9.4.3-P5 <<>> -x 2404:6800:8004::68
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 35573
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;8.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.0.0.8.0.0.8.6.4.0.4.2.ip6.arpa. IN PTR
    
    ;; Query time: 364 msec
    ;; SERVER: 12.165.58.2#53(12.165.58.2)
    ;; WHEN: Thu Sep  2 03:45:50 2010
    ;; MSG SIZE  rcvd: 90
    

    edit: Finally found an ipv6 address that has reverse DNS associated. In short, works4me.

    >>> import socket
    >>> socket.has_ipv6
    True
    >>> socket.getfqdn('2001:838:2:1::30:67')
    'gatey.sixxs.net'
    

    And from dig:

    $ dig -x 2001:838:2:1::30:67
    
    ; <<>> DiG 9.4.3-P5 <<>> -x 2001:838:2:1::30:67
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 934
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 1
    
    ;; QUESTION SECTION:
    ;7.6.0.0.0.3.0.0.0.0.0.0.0.0.0.0.1.0.0.0.2.0.0.0.8.3.8.0.1.0.0.2.ip6.arpa. IN PTR
    
    ;; ANSWER SECTION:
    7.6.0.0.0.3.0.0.0.0.0.0.0.0.0.0.1.0.0.0.2.0.0.0.8.3.8.0.1.0.0.2.ip6.arpa. 43200 IN PTR gatey.sixxs.net.
    
    ;; AUTHORITY SECTION:
    .                       517204  IN      NS      e.root-servers.net.
    .                       517204  IN      NS      m.root-servers.net.
    .                       517204  IN      NS      a.root-servers.net.
    .                       517204  IN      NS      l.root-servers.net.
    .                       517204  IN      NS      c.root-servers.net.
    .                       517204  IN      NS      h.root-servers.net.
    .                       517204  IN      NS      j.root-servers.net.
    .                       517204  IN      NS      g.root-servers.net.
    .                       517204  IN      NS      f.root-servers.net.
    .                       517204  IN      NS      i.root-servers.net.
    .                       517204  IN      NS      d.root-servers.net.
    .                       517204  IN      NS      b.root-servers.net.
    .                       517204  IN      NS      k.root-servers.net.
    
    ;; ADDITIONAL SECTION:
    a.root-servers.net.     604222  IN      A       198.41.0.4
    
    ;; Query time: 383 msec
    ;; SERVER: 12.165.58.2#53(12.165.58.2)
    ;; WHEN: Thu Sep  2 03:55:03 2010
    ;; MSG SIZE  rcvd: 343
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Socket.Dispose() is an inaccessible member. However, we can bypass this by doing the following:
Socket has a constructor that takes a winsock SOCKET as parameter and stores it
When I call socket.getsockname() on a socket object, it returns a tuple of my
When I create a socket using accept() and make a FILE out of it
Using C / C++ socket programming, and the read(socket, buffer, BUFSIZE) method. What exactly
In any socket API the close() method closes a connection with a FIN. If
There is a socket related function call in my code, that function is from
I want to open a TCP client socket in Python. Do I have to
I'm using a Java socket, connected to a server. If I send a HEADER
I am a bit confused about socket programming in C. You create a socket,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.