Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS Lookup not working #9

Closed
asimzeeshan opened this issue Jan 29, 2021 · 3 comments
Closed

DNS Lookup not working #9

asimzeeshan opened this issue Jan 29, 2021 · 3 comments

Comments

@asimzeeshan
Copy link
Contributor

DNS lookup is not working

calls.php?type=A&hostname=vps.domain.ext

the issue is in calls.php file

} elseif ($_GET['type'] == 'dns_search') {

should be replaced with

        } elseif ($_GET['type'] == 'A' || $_GET['type'] == 'AAAA') {

Also on a side note, PHP now has a function to get DNS records (https://www.php.net/manual/en/function.dns-get-record.php), I will advise you to use these (they return array)

# get only A record
dns_get_record($_GET['hostname'], DNS_A);

# get only AAAA record
dns_get_record($_GET['hostname'], DNS_AAAA);

# get both A and AAAA records
dns_get_record($_GET['hostname'], DNS_A + DNS_AAAA);

@cp6
Copy link
Owner

cp6 commented Jan 29, 2021

Thanks @asimzeeshan

e876d93005e3313fbb0698c87cae8571c6af4c97

I see that you tried a fix.

The inbuilt DNS functions is in this issue

@asimzeeshan
Copy link
Contributor Author

Awesome!!!

Creating a pull request for dns_get_record() proposed changes

@asimzeeshan
Copy link
Contributor Author

Updated pull request (#10) with class.php code, here are my changes for the native DNS lookup

a89f624

@cp6 cp6 closed this as completed Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants