DNS tools not working properly

29 views
Skip to first unread message

Devils Kiddo

unread,
Aug 7, 2019, 4:21:00 AM8/7/19
to Vagrant
I am trying to find DNS records using host and dig commands.

Using Host I am only getting the A record and the following error:

Sorin@centos7 ~  $ host google.com
google.com has address 172.217.18.78
Host google.com not found: 3(NXDOMAIN)
Host google.com not found: 3(NXDOMAIN)

Using dig any +short I am only getting the A record instead of the full DNS zone records:

Sorin@centos7 ~  $ dig google.com any +short
216.58.214.206

If you need anything to help me out let me know

Jim McGinness

unread,
Aug 7, 2019, 5:01:13 AM8/7/19
to Vagrant
Try using "host -v google.com" to get some additional information. There's nothing special about the vagrant install - the guest system is going to rely on the dhcp response (or whatever network configuration you've specified) to locate a DNS resolver. I suppose some resolvers provide only limited lookup services.

Devils Kiddo

unread,
Aug 7, 2019, 5:18:04 AM8/7/19
to Vagrant
This is what I got:

Sorin@centos7 ~  $ host -v google.com
Trying "google.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20567
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             3600    IN      A       216.58.214.206

Received 44 bytes from 10.0.2.3#53 in 19 ms
Trying "google.com"
Received 28 bytes from 10.0.2.3#53 in 0 ms
Trying "google.com"

Host google.com not found: 3(NXDOMAIN)
Received 28 bytes from 10.0.2.3#53 in 0 ms
Trying "google.com"
Received 28 bytes from 10.0.2.3#53 in 0 ms
Trying "google.com"

Host google.com not found: 3(NXDOMAIN)
Received 28 bytes from 10.0.2.3#53 in 0 ms

Previously I was editing the hosts file but not sure if I remember the command to edit it right: sudo nano /etc/hosts
If that was it  is looking different now
I was replacing the resolvers in there with the Google one's (8.8.8.8 and 8.8.4.4) and it was working just fine

Devils Kiddo

unread,
Aug 7, 2019, 5:26:11 AM8/7/19
to Vagrant
EDIT: I was editing the resolv.conf file via: sudo nano /etc/resolv.conf from:
# Generated by NetworkManager
nameserver 10.0.2.3

TO
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

Saving the settings and then the commands work just fine:

Sorin@centos7 /  $ host google.com
google.com has address 172.217.19.110
google.com has IPv6 address 2a00:1450:400d:809::200e
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.

However, I have to do this everytime I am ssh-ing into vagrant cause the changes won't save. Any idea why is that?

Thanks


Jim McGinness

unread,
Aug 7, 2019, 5:05:59 PM8/7/19
to Vagrant
Those changes to resolv.conf should persist across ssh logins - unless you're doing a "vagrant reload" or otherwise recreating the VM.

Something else is going on. It could be that Network Manager is rewriting the resolv.conf file whenever the dhcp lease is renewed. Are you in control of your DHCP server? Is it possible to change the DNS providers that it propagates to its clients?
Message has been deleted

Devils Kiddo

unread,
Aug 8, 2019, 3:49:43 PM8/8/19
to Vagrant

I am on Windows 10, using a centos 7 box, for DNS tools, mostly. I need them for domains and DNS stuff. Unfortunately I have no idea what you are referring to. I don't suppose this file exists anywhere, at least in the vagrant folder? I have looked everywhere for it

Alvaro Miranda Aguilera

unread,
Aug 8, 2019, 3:53:40 PM8/8/19
to vagra...@googlegroups.com
try adding this

config.vm.provider :virtualbox do |vb|
  vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c35895bd-30fb-4660-b3ea-3f1e15264571%40googlegroups.com.


--
Alvaro

Devils Kiddo

unread,
Aug 13, 2019, 9:50:32 AM8/13/19
to vagra...@googlegroups.com
Tried to add that, it didn't work for me, kept getting code errors in the console. I'll keep editing the resolv.conf fiile and that's it I guess :D

Thanks to everyone

On Sun, Aug 11, 2019 at 1:08 PM Dennis Chang <dennis...@gmail.com> wrote:
I might be way off base here, but this reminds me of Ubuntu 18.04 LTS using Netplan which configures amongst other things the /etc/resolv.conf file.
IIRC, /etc/resolv.conf is auto-configured to point to a local dnsmasq server. And I believe the dnsmasq server auto-populates with successful
name resolutions, cacheing the results for future lookups (I'm guessing here because I never really investigated how it was setup or works).

Netplan is configured through the file /etc/netplan/01-netcfg.yml.

Perhaps Centos7 is using the same network configuration as Ubuntu 18.04 LTS. Something you can check out.

I just did a google search and here's an interesting post (https://renediepstraten.nl/?p=56), something worth checking out.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages