Not able to add GitLab package repository

I am unable to add the GitLab package repository as described in Step 2 of “Download a GitLab Omnibus package” at this link

The error/message I am receiving on the command line is:
curl: (6) Could not resolve host:


Hi @kurtreynolds11, good question!

From the error message, it sounds like a networking issue.

To help troubleshoot, can you confirm that the instance has internet access?

Are you using IPv6?

Can you share the output of: grep nameserver /etc/resolv.conf to see if DNS is causing the URL to be unresolvable?

We should be able to diagnose where the issue is occurring by reviewing the output of any/all of the following commands executed on the GitLab server:

  • ping
  • curl -v
  • host
  • dig
  • traceroute

Let us know what you find out!

1 Like

Yes, I also believe it is a network connection issue.

The output of grep nameserver /etc/resolv.conf is "nameserver

GitLab server:

  • ping = Temporary failure in name resolution

  • curl -v

  • host = Host not found: 2(SERVFAIL)

  • dig
    Got answer:
    opcode: QUERY, status: SERVFAIL, id: 63684
    flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

        EDNS: version: 0, flags: ; udp: 65494
  • traceroute = Command ‘traceroute’ not found, but can be installed with: …
    When I try to install any additional commands/utilities, I receive "E: Unable to locate package ".


The output of grep nameserver /etc/resolv.conf is nameserver

This indicates that your machine is using itself (localhost) to handle DNS.

If you’re not running a DNS server on port 53 of this machine, then your system will not be able to translate into an IP address, which is required to resolve the DNS query and fetch the packages.

To fix this, I suggest using a publicly available DNS provider like Google (, Cloudflare (, OpenDNS ( or quad 9 (

What does this mean? How do I do this?

Note: I added nameserver to file resolv.conf.


If you’ve set nameserver in resolv.conf, that should basically tell the system to use Google for DNS (ip

Did you try to add the GitLab package repository after having added nameserver in your /etc/resolv.conf?

How do I do this?

Editing /etc/resolv.conf directly is a one quick and easy way to change switch dns - it works, but its not a best practice.
For best results, I suggest a good old-fashioned Google search for "change DNS settings on <linux_distribution> "

I still cannot ping

This may not be the correct way of doing things, but I find it is a way that often works for me. If you are using Ubuntu as your OS, you may find you are using Dnsmasq, so your machine is using its self for DNS lookups. The guide below changes this to use a normal resolv.conf file. As I say it may not be the correct way of sorting this, but it seems to work a majority of the time.

You will either need to sudo su - (to become root) or run all these commands starting with sudo.

cd /etc

ls -l

Check resolv.conf for me. It will probably be a link to /run/systemd/resolve/stub-resolv.conf

If it is.

rm /etc/resolv.conf

This will remove the link.

ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

This will create a new link to the normal resolv.conf file.

Do an nslookup of the again and check the connection like before. The second run of the nslookup should be from a different DNS server rather than from It should be a normal DNS server this time.

When you mentioned this

If you’re not running a DNS server on port 53 of this machine

Does that mean that I should have a proxy setup? Because I did not setup a proxy.

I no longer have the server set to I commented this out in the resolv.conf. So now when I run grep nameserver /etc/resolv.conf, I get an output of

  • #nameserver
  • nameserver
  • nameserver

Is nslookup a Linux command? I’m not familiar with the terminology.

Okay, so I followed your instructions and then ran the command nslookup The output was connection timed out; no servers could be reached
I get the same output when I run nslookup

Pinging and still produces Temporary failure in name resolution.

nslookup is a fairly standard command, used in both windows and Linux. What do you get if you just run.


Then you should get a prompt like >

then type


This should tell you your default server. To switch DNS servers you can just add the IP address, so to switch to google type this.


Also from the > prompt, you can type what you are searching for.

I finally installed the desktop edition of Ubuntu and am able to connect to the web via both wired (ethernet) and Wi-Fi. I’m not sure if I somehow installed the server edition wrong or if there was something wrong with the iso image that I downloaded.

I now have the GitLab Repo package installed and am playing around with it. Thank you everyone for your input and help!


1 Like