Consul will not resolve DNS names on ubuntu 18.04

I’m pretty new to all this, but shared similar issues, that I partly resolved.

The only reason why I use ubuntu 18 is because of the AWS vault deployment example, and I also use open vpn ami’s which are ubuntu 18. I’m open to alternatives though…

I tried to use https://github.com/hashicorp/terraform-aws-consul.git

In ubuntu 18, I found that /etc/resolv.conf was not linked to /run/systemd/resolve/resolv.conf, and although I could be wrong, this seems incorrect

I assume this is why it attempts to use 127.0.0.53 to resolve dns, which is definitely a part of the problem

So if I do this,

"sudo unlink /etc/resolv.conf",
"sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf"

Then this now works where previously it didn’t:

dig vault.service.consul

but… as soon as I do that,
i’ll see another error when I use sudo:

sudo: unable to resolve host ip-172-31-19-129: Resource temporarily unavailable

And that is because the hostname (ip-172-31-19-129) doesn’t exist in /etc/hosts.
So if ubuntu doesn’t set the hostname in /etc/hosts, how does it resolve it normally? Considering this information, I wonder if im on the right path and there is just some other missing piece…

I would love to find a golden answer to this problem. It seems google produces so many different solutions to the topic…