Menu

#4 win32dns.py fails on windows server 2003

open
nobody
None
5
2005-04-10
2005-04-10
Anonymous
No

The RegistryResolve function in win32dns.py returns an
empty array in windows server 2003.

Discussion

  • craig

    craig - 2006-11-27

    Logged In: YES
    user_id=1258995
    Originator: NO

    I am on Win XP Pro, and have the same problem. I looked into the win32dns.py source code and found that it looks into the windows registry for the "NameServer" key. However, in my case the value for NameServer is empty. However, I do have an entry under DhcpNameServer, so I added 6 lines of code to win32dns.py to check both NameServer and DhcpNameServer for values.

    I will try to attach the updated win32dns.py file.

     
  • craig

    craig - 2006-11-27

    Logged In: YES
    user_id=1258995
    Originator: NO

    Ok I can't seem to attach the file so you will have to manually edit win32dns.py.

    look for this chunk of code:
    try:
    nameserver,dummytype=_winreg.QueryValueEx(z,'NameServer')
    if nameserver and not (nameserver in nameservers):
    nameservers.extend(stringdisplay(nameserver))
    except EnvironmentError:
    pass

    (starts around line 94)

    ....immediately after that "try/except" block, paste this code...
    try:
    nameserver,dummytype=_winreg.QueryValueEx(z,'DhcpNameServer')
    if nameserver and not (nameserver in nameservers):
    nameservers.extend(stringdisplay(nameserver))
    except EnvironmentError:
    pass

    see the only difference is that now instead of only checking for "NameServer" it will check for "DhcpNameServer" as well.

    hope that helps someone :)

     
  • Scott Kitterman

    Scott Kitterman - 2007-02-15

    Logged In: YES
    user_id=1300068
    Originator: NO

    Bug #863364 in the patches section has a different approach to fixing this same problem.

     
  • Scott Kitterman

    Scott Kitterman - 2007-02-16

    Logged In: YES
    user_id=1300068
    Originator: NO

    A fix for this issue has been included in the latest python-dns update in Ubuntu Linux. See https://launchpad.net/ubuntu/+source/python-dns/2.3.0-5.1ubuntu2 for details.

     
  • Scott Kitterman

    Scott Kitterman - 2007-11-19

    Logged In: YES
    user_id=1300068
    Originator: NO

    Fixed in 2.3.1