# Displaying domain name in URL



## balanga (Jul 19, 2019)

I've just registered a domain and am trying access my website on a VPS. The Domain is resolved to the correct IP address but when I try browsing http://www.abc.xyz I go to 123.123.123.123. I'd prefer to have the domain name in the URL rather than the IP address. 

Not sure how to do that... is it a configuration option in Apache, or is it something I need to change in the DNS record?


----------



## drhowarddrfine (Jul 19, 2019)

I don't have a clue how that could have happened. Is the site just a plain "Hello, World!" with nothing in it at the moment? Which browser?


----------



## balanga (Jul 19, 2019)

It seems to have automagically sorted itself out.... The wonder of computers!!


----------



## ucomp (Jul 19, 2019)

balanga said:


> It seems to have automagically sorted itself out.... The wonder of computers!!


people who do not so much believe in magic 
call that wonder :  *DNS propagation time*


----------



## drhowarddrfine (Jul 19, 2019)

I would have mentioned that but how did the browser know what address it was at? Did you put it in /etc/hosts or something?


----------



## ucomp (Jul 19, 2019)

drhowarddrfine said:


> I would have mentioned that but how did the browser know what address it was at? Did you put it in /etc/hosts or something?


browsers also have some sort of "automagically self outsorting wonder "  ,
people who do not so much believe in magic
call that wonder : *Browser-Cache  *
--
to add:
Browsers have special menu-functions for development -
emptying the cache is one these functions ...
-
another addition :
depending on some webserver-vendors it is also sometimes required to restart 
the httpd-service ...


----------



## drhowarddrfine (Jul 20, 2019)

ucomp No. Browser cache has nothing to do with domain resolution of non-existent names and what appears in the address bar.


----------



## ucomp (Jul 20, 2019)

drhowarddrfine said:


> ucomp No. Browser cache has nothing to do with domain resolution of non-existent names and what appears in the address bar.


Hi,

O.K., lets shot a light in the magic :
One could only know what probably happened at balanga when he wrote
that a magician was at work who solved all  .
The information from the initial posting was not clear -
if balanga would have known what was really happening he wouldn`t have asked ...


drhowarddrfine said:


> domain resolution of non-existent names...



if the *A-Record *wouldn't have set by "the Magician" and wouldn't exist,
the Magician would have had no chance, but he succeeded.
So the name exists but didn't appear in the address bar because of
DNS propagation time and/or Browser-Cache.
Of course, we  do not know exactly in which order or combination, because we are not sitting next to balanga and probably even balanga doesn't know or remember.
but that doesn't matter...
... if you've done server-setups approx. 50.000 times, you know that when you first set up a web server, you're dealing with dns propagation time , browser cache & WebServer-Configuration(proxies, folders, symlinks and so on and so forth...).
Since balanga didn't touch the configuration-files (from what he wrote/told) and only the Magician was at work-
it was clear what happened , because that are always the same procedures...
so a web-dev  has to deal with  Cache-control, not only on the client-side but also on the sever-side  ... but that's another topic, not for today.. but just to turn off the light in magic right away ;-) :
*Session-lifecycles/management , parameter, getter/setter, proxy-server, EcmaScript, Ajax, CSS , node , json, Python, java servlets, tomcat, certbot ... *
happy coding !
O.K, thanks for reading,
good night

P.S: 
----
Of course, I assume that abc.xyz was just a nick for an actual domain with a different name owned by balanga.
If that's not the case and this has been an offline fake test, we can forget this thread, but I guess it was a real  Sevrer scenario that balanga described ...
apart from this : abc.xyz is a *FQDN*...
---


----------



## drhowarddrfine (Jul 20, 2019)

ucomp I'll say it again. Entering a domain name into a browser address bar and having an IP address show up there has nothing to do with domain name resolution or browser cache. The browser does not know the address of any domain until it gets that from DNS. You can't have the domain name and address in cache until it's been accessed and the whole thing has been resolved. 

So it isn't clear how typing in the domain name into the address bar returns an IP address there when DNS is not yet working.


----------



## balanga (Jul 20, 2019)

It's nice to know from the discussion above that it was not such a stupid question...

An observation that I have just made is that on one of my systems, the address bar still shows the IP address even though I typed in a domain name (and yes, www.abc.xyz was just an example). I guess this must still be in Google's cache... so would not show up this way if starting up a new browser.
On other systems the domain is displayed in the address bar. 

One odd thing is that the system which displays the IP address shows the homepage - a Wordpress post formatted correctly, whereas on the other systems it is displayed as a simplified html page - not sure how to describe it.


----------



## ucomp (Jul 20, 2019)

balanga said:


> ... I guess this must still be in Google's cache... so would not show up this way if starting up a new browser....


1 possibility:
DNS propagation time means that in the 1st hours not all name servers worldwide
are synchronised at the same moment with the new dns-entry .....
so it might possible that on 1 system you resolve another name server than on the other system.
In FreeBSD this is /etc/resolv.conf
other possibility :
there is a thing called autofill in some browser, which  means , you want type : abc.com but
after typing the letter 'b' the address bar autofills with abuse.com 
--
from a dev`s view to prevent unknown behaviour of client-browsers or target systems , you have to force the target system to do what you expect ...
--


balanga said:


> ...
> 
> One odd thing is that the system which displays the IP address shows the homepage - a Wordpress post formatted correctly, whereas on the other systems it is displayed as a simplified html page - not sure how to describe it.



well,  you can try to force to reload the page , browsers have so called rendering-engines , e.g. Apple Web Kit... so as a dev it is good to know who your client-system is, you will control that...
in the past many browsers had totally different behaviour , so the devs had more to do with addressing those issues than to design their product. Nowadays the standards are more compatible, e.g. html5, those things are recommended e.g.  by W3C .
So if one browser shows other results than the other ,
this could be caused by e.g. client-side javascript-code which addresses the browser-engine or by code on the web server or the cache or the name server(for the 1st hours)..... .

For your 1st steps you are absolutely doing the right thing :
You test on different browser-engines & client-systems  

--- edit :---


drhowarddrfine said:


> ucomp ...... The browser does not know .....
> So it isn't clear....


the browser knows(saves) a lot but we don't know a lot of balanga`s environment...
so we make the web-environment a little clearer :
we haven't seen what's exactly inside the web-server-conf & the DNS-entries and we (including balanga) do not know WHEN those changes took affect at WHAT place .
So we begin with making all things clear we know: e.g. the browser-Cache-thing ,
if a server-programmer doesn't control the client-side cache(what the client really sees)  e.g @subway your customers 
order 1 btl. Coke but receive  food for 500$


----------

