# FreeRadius radtest connection



## alexrezistorman (Jan 5, 2015)

Hi!
I have some troubles with freeradius and radtest.
So, I've installed freeradius3 on

```
FreeBSD I13S 10.0-RELEASE FreeBSD 10.0-RELEASE #1:
```
Set up authorization and try check connection from localhost with

```
radtest raduser P@ssw0rd localhost 0 testing123
```
It returned

```
(0) Error parsing "-": ip_hton: hostname nor servname provided, or not known
```

How can I fix it?


----------



## bra1n (Jan 5, 2015)

Just a guess, but maybe localhost isn't defined in your /etc/hosts file.  Try checking that or using 127.0.0.1 as the server IP, or ::1 if you're using IPv6.


----------



## alexrezistorman (Jan 5, 2015)

Yep, thanks! It was necessary to add "I13S" (machine name) to /etc/hosts in line with localhost.


----------



## Amanpreet Singh (Sep 24, 2016)

Yes, It was needed to add hostname corresponding 127.0.0.1.
Actually, It happens when we have changed the hostname.
I have fixed it by using following commands
nano /etc/hosts/

then add an entry :
127.0.0.1 myvpsserver

here "*myvpsserver*" is my hostname


----------

