Skip to content
Advertisement

GCP Startup-Script for setting DNS entries RHEL-7

I’m trying to expand my Google Cloud Platform startup-script so that it sets DNS entries. But every time I include these two lines of code the script does not get executed and fails.

echo "nameserver 0.0.0.0" >> /etc/resolv.conf
echo "nameserver 0.0.0.1" >> /etc/resolv.conf

When I login to the Virtual Machine the commands work fine.

The Error message I get is the following:

Screenshot of Error Message from serial console

Advertisement

Answer

Please include error messages as text, not as a screenshot.

U+00A0 is a non-breaking space, which looks like an ordinary space, but is not. You need to check the input to make sure that there is a real ASCII space character there (U+0020), and not some other Unicode character.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement