2

I'm developing a website and i'm using the PHP function dns_get_record to get some data from the DNS server. To proper show the problem I will show an example of getting the NS record from a domain first with CentOS 7

Command: dig php.net NS
Result:

;; ANSWER SECTION:
php.net. 299 IN NS dns4.easydns.info.
php.net. 299 IN NS dns3.easydns.org.
php.net. 299 IN NS dns2.easydns.net.
php.net. 299 IN NS dns1.easydns.com.

Also when I try to get the A record it give me proper result

But when I'm using this command on my vagrant box (Ubuntu Homestead) I don't get any NS records, there isn't an answer section...

But, when I do the same on the A record there is an answer. How can it be that a domain without any NS can resolve to an IP?

Also when I do the same on Google Dig I get the expected result

Any help will be very appreciated.

3
  • 2
    Can you share some information on your vagrant box? How was it setup? How is its IP stack configured and the /etc/resolv.conf file etc...
    – Tommiie
    Commented Oct 19, 2018 at 8:48
  • I took a look in /etc/resolv.conf and found it was pointing to the wrong nameserver... Thanks! Commented Oct 19, 2018 at 9:07
  • can you please post a detailed answer and mark it as accpeted, in case it helps someone else?
    – bgtvfr
    Commented Oct 19, 2018 at 9:30

1 Answer 1

1

After installing the default Vagrant box with Laravel/Homestead and rebooting it I needed to change the /etc/resolv.conf - there was a wrong nameserver listed in that e. I've changed 127.0.0.53 to 8.8.8.8 and that solved it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .