# /etc/hosts: Can I bind my dynamic DNS hostname to 127.0.0.1/localhost?



## michaelsanford (Mar 27, 2003)

I use a dynamic DNS client (no-ip.com).

Is it possible to add a line to /etc/hosts like:

```
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
[b]amras.no-ip.com localhost[/b]
```

The idea behind this is to prevent an outgoing WAN connection if I enter my no-ip.com aliased hostname locally (web browser, terminal, etc) to save speed and bandwidth.

I know I can just substitute 127.0.0.1/localhost in most instances, but that requires updating (or keeping multiple copies of) some scripts that use absolute hostnames.

I'm only asking because I could try this, but not notice any difference, so I might not know if it's actually doing anything


----------



## lurk (Mar 27, 2003)

Close don't add it as a new entry but as an alias on the original like this 

```
127.0.0.1       localhost amras.no-ip.com
```
You can also add it as a new independent entry like this

```
127.0.0.1       amras.no-ip.com
```

Either one should work if your mac is doing its name resolution in the right order.  

-Eric


----------



## michaelsanford (Mar 27, 2003)

done, thanks!

What do I have to do to reload the new host table, if anything?


----------



## lurk (Mar 27, 2003)

You should not have to do anything, But I could be wrong so if it doesn't work the would reboot will fix it though I am loathe to do that.

-Eric


----------



## michaelsanford (Mar 27, 2003)

I just played with it and I noticed a dramatic speed increase on FTP connection, directory listing, etc; so it seems to be working after all without reloading anything.


----------



## Darkshadow (Mar 27, 2003)

You can also add this in with NetInfo, then Cocoa apps would benefit too.  I did it.

Open up Netinfo Manager, authenticate yourself, go to machines -> localhost

Click on the name property, choose Insert Value from the Directory Menu, and add in amras.no-ip.com.

Then go and click on broadcasthost.  That's just so NetInfo Manager asks if you want to save & update.  (I suppose you can do command-s as well )

Then go up to the Management menu and choose Restart Local Netinfo Domains.  That'll put it into effect.


----------



## michaelsanford (Mar 27, 2003)

Very, very cool DarkShadow!


----------



## kenny (Mar 27, 2003)

Or (riffing on that other thread), you could use amras.no-ip.local. and not have to modify any configs at all...


----------



## michaelsanford (Mar 29, 2003)

That's true eh....


----------

