Help me map my domain to my ip address

I need help mapping my domain to my ip address. I am a complete novice and need someone to be very clear what I need to write.

Let's suppose my ip address is 1.2.3.4, my domain is "google.com", and my hostname is "computer" (i.e. my command prompt looks something like me@computer:).

What should my first two lines of /etc/hosts look like?

Also, when I set an A/AAAA record, do I put "computer" in the Hostname field?

P.S. I am looking for a clear answer, not a link to a tutorial that I've already read, but didn't fully understand.

Thanks in advance.

3 Replies

I did. Please reread my post.

For the A record you'll want to leave the hostname blank if the DNS zone is for the domain in question. All records in the DNS zone are assumed to be for the domain the zone was created for, so leaving the hostname field blank will make a record for that domain.

For example, if the DNS zone is for 'example.com' and you want to point 'example.com' to 1.2.3.4, then when creating an A record the "Hostname" field will be blank and the "IP Address field will be 1.2.3.4.

For /etc/hosts, if you want to direct your Linode or local computer to look for 'example.com' at 1.2.3.4 then just add the following:

1.2.3.4 example.com

It'll work for any other combination of IP address and domain, as well.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct