apache / apache/libcloud

Possible error in godaddy & hostvirtual DNS RECORD_TYPE_MAP

Open
#1,520 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
2.1k
Forks
931
Avg merge
1d 2h
Merged PRs (30d)
4

Description

## Summary

[libcloud/dns/drivers/hostvirtual.py](libcloud/dns/drivers/hostvirtual.py#L65) and [libcloud/dns/drivers/godaddy.py](libcloud/dns/drivers/godaddy.py#L111) both contain the following definition:

```
RECORD_TYPE_MAP = {
RecordType.A: 'A',
RecordType.AAAA: 'AAAA',
RecordType.CNAME: 'CNAME',
RecordType.MX: 'MX',
RecordType.NS: 'SPF',
RecordType.SRV: 'SRV',
RecordType.TXT: 'TXT',
}
```

The line `RecordType.NS: 'SPF',` is very unusual. I suspect this is a bug. This is only two of three places in the libcloud/driver library where there is a mismatch between record type and name. (The other is in cloudflare.py, which defines `RecordType.URL: 'LOC'`).

If it is really not a bug, I suggest to add a comment explaining this mismatch.

My apologies for not adding a full bug report with reproducible code. I encountered this during a coarse check which record types are commonly supported.

Contributor guide

Open the contributing guide

Research direction

Start with the RECORD_TYPE_MAP definitions at libcloud/dns/drivers/hostvirtual.py#L65 and libcloud/dns/drivers/godaddy.py#L111. Compare the provider APIs' handling of NS and SPF records, then inspect the corresponding DNS driver tests if available. Done means confirming the mapping is correct or fixing it, with a comment explaining the mismatch if it is intentional.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.