# startX bad display name



## NAC (Oct 28, 2009)

after googled online, havent found any helpful clues.

whenever i run "startx", i need to wait about 1 min or use "ctrl_C" to abort following error for staring X-environment 

```
"Xauth:(argv): bad display name "localhost.local:0" in "list" command
```
I have tried to disable /etc/hosts lines or re-edit the content, but havent sorted it out.

i am wondering if someone could help with? thanks a lot


----------



## vaclinux (Oct 28, 2009)

could you post your /etc/hosts ?


----------



## NAC (Oct 28, 2009)

thanks for your reply, 
i am using the default at the moment 

```
::1			localhost localhost.my.domain 
127.0.0.1		localhost localhost.my.domain
```

I am wondering the domain name can be anything or not?


----------



## crsd (Oct 28, 2009)

You should put value of your `hostname` to /etc/hosts, like:

```
::1  yourhostname yourhostname.yourdomain localhost
127.0.0.1  yourhostname yourhostname.yourdomain localhost
```


----------



## fronclynne (Oct 28, 2009)

NAC said:
			
		

> thanks for your reply,
> i am using the default at the moment
> 
> 
> I am wondering the domain name can be anything or not?


It shouldn't conflict with existing namespace, I believe.  Put something with more than four letters to the right of the dot and you should be safe.  I usually set my hostname to a single, longish name, like britomart, or belphoebe, or duessa.

The problem I suspect you are having is that your hostname is set to one thing in /etc/rc.conf & that doesn't match your /etc/hosts.


----------



## NAC (Oct 28, 2009)

fronclynne said:
			
		

> It shouldn't conflict with existing namespace, I believe.  Put something with more than four letters to the right of the dot and you should be safe.  I usually set my hostname to a single, longish name, like britomart, or belphoebe, or duessa.
> 
> The problem I suspect you are having is that your hostname is set to one thing in /etc/rc.conf & that doesn't match your /etc/hosts.



thank you, yes you are right, in rc.conf 
hostname="locahost.local"

 iam going to have a try


----------



## SirDice (Oct 28, 2009)

Don't use .local as a TLD and don't use localhost as a hostname.


----------



## NAC (Oct 28, 2009)

i edited /etc/hosts 


> ::1			freebsd.villa.org localhost
> 127.0.0.1		freebsd.villa.org localhost


and re-edited /etc/rc.conf


> hostname="freebsd.villa.org"



just fixed it after rebooting, thanks a lot guys.
really appreciate it!


----------



## DutchDaemon (Oct 28, 2009)

Use 
	
	



```
, not [quote] please!
```


----------



## sprewell (May 14, 2010)

I just had this same problem where I had setup some local and remote FreeBSD jails but after changing the IPs, X forwarding stopped working with a similar xauth error.  I had to make sure the correct domain and IP was properly placed in /etc/hosts inside the jails and X forwarding started working again.


----------



## R0B R0D (Jan 30, 2015)

Helpful. After rebooting!  Thanks. Newbie from Linux. 10.1 My first install.


----------

