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

Name resolution problem with AWS Ubuntu 18.04 #12

Closed
HunterOfBounties opened this issue Jul 27, 2020 · 2 comments
Closed

Name resolution problem with AWS Ubuntu 18.04 #12

HunterOfBounties opened this issue Jul 27, 2020 · 2 comments

Comments

@HunterOfBounties
Copy link

Hi Putsi,

Thanks for this awesome script!

I tried running this on a fresh AWS Ubuntu 18.04. After running install.sh, name resolution stopped working. Commenting out these lines from install.sh seem to solve the issue:

systemctl disable systemd-resolved.service
systemctl stop systemd-resolved
rm -rf /etc/resolv.conf
echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "options edns0" >> /etc/resolv.conf
echo "search eu-north-1.compute.internal" >> /etc/resolv.conf

@HunterOfBounties
Copy link
Author

You can change the default AWS nameserver by creating a file 99-custom-dns.yaml located at /etc/netplan:
sudo vim /etc/netplan/99-custom-dns.yaml

Contents of the file:

network:
    version: 2
    ethernets:
        ens5:         
            nameservers:
                    addresses: [8.8.8.8, 1.1.1.1]
            dhcp4-overrides:
                    use-dns: false

(Replace ens5 with your network interface name. )

After this reboot the machine or run:
netplan apply

To see, if new nameservers are applied correctly, run:
systemd-resolve --status

This is explained in this AWS knowledge base article:
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-static-dns-ubuntu-debian/

@putsi
Copy link
Owner

putsi commented Jan 5, 2021

systemctl disable systemd-resolved.service
systemctl stop systemd-resolved
rm -rf /etc/resolv.conf
echo "nameserver 1.1.1.1" > /etc/resolv.conf

The above lines were needed previously because systemd-resolved bound the port 127.0.0.1:53 and that caused issues.
I think old version of certbot or old version of Burp Collaborator required port 53 on localhost which broke things and needed systemd-resolved to be disabled.

I think it might be possible to remove that hack now, but I'll have to test if it actually is possible.

@putsi putsi closed this as completed in 22b81e3 Feb 1, 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