1

I have the following servers, which should be used for the following tasks:

big_box   111.111.111.111 Main-Server (Game-Server, Virtual Machines,...)
small_box 222.222.222.222 Web-Server

The idea is later (if I get this to run) to add more "small_box" type servers for load balancing.

I own a domain and I tried to setup the following DNS entries:

Host                         TTL    Type Preference Data
*.example.org                30     A    20         111.111.111.111
example.org                  30     A    20         111.111.111.111
example.org                  30     MX   20         mail.example.org
example.org                  86400  NS   20         ns1.nameserver.org
example.org                  86400  NS   20         ns1.nameserver.org
example.org                  86400  NS   20         ns1.nameserver.org
_http._tcp.example.org.      30     SRV  10         10 80 222.222.222.222
_http._tcp.www.example.org.  30     SRV  10         10 80 222.222.222.222
_https._tcp.example.org.     30     SRV  10         10 443 222.222.222.222
_https._tcp.www.example.org. 30     SRV  10         10 443 222.222.222.222

I waited more than twenty-four hours to let the changes propagate and I can lookup the SRV entries with:

dig _http._tcp.exmaple.org

and get as answer:

; <<>> DiG 9.9.5-3ubuntu0.6-Ubuntu <<>> _http._tcp.example.org SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45370
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 4

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_http._tcp.exmaple.org.    IN  SRV

;; ANSWER SECTION:
_http._tcp.example.org. 30  IN  SRV 10 10 80 222.222.222.222.

;; AUTHORITY SECTION:
example.org.    69477   IN  NS  ns2.nameserver.org.
example.org.    69477   IN  NS  ns1.nameserver.org.
example.org.    69477   IN  NS  ns3.nameserver.org.

;; ADDITIONAL SECTION:
ns1.nameserver.org.     2470    IN  A   xxx.xxx.xxx.xxx
ns2.nameserver.org.     977 IN  A   xxx.xxx.xxx.xxx
ns3.nameserver.org.     2470    IN  A   xxx.xxx.xxx.xxx

;; Query time: 32 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Tue Feb 02 02:18:13 CET 2016
;; MSG SIZE  rcvd: 212

But when I am trying get the webpage under any of the following

http://example.org
http://www.exampleuorg
https://example.org
https://www.example.org 

I always end up on 111.111.111.111 instead of 222.222.222.222.

(I setup 4 small webpages on Apache2 servers, stating which machine under which protocol I reached.)

Also:

traceroute example.org      
traceroute www.example.org  
traceroute -p 80 example.org      
traceroute -p 80 www.example.org  
traceroute -p 443 example.org      
traceroute -p 443 www.example.org

all end up on 111.111.111.111, which is OK for the first 2 requests, but not for the rest.

I did try to find examples for A and SRV entries together, but I didn't found any, just separate examples. I also didn't find statements that you can't use both at the same time.

Did I do something wrong?

  • Perhaps you need to give it a bit more time. Using HTTP will use a DNS cache whereas dig will not. As well, I have found, for whatever reason, dig may not use the default DNS of the machine and can hit the DNSs defined in your router. If these are different, you will find different results from time to time for somethings. I never really studied why, I just made sure that all DNS IP address entries agreed except where the internal DNS is required. As well, you may want to make your DNS on your server and router the same as your SOA at least for testing. – closetnoc Feb 2 '16 at 2:41
  • SRV records are unnecessary. Register dns records for www and example.org to the desired IP address. – user2320464 Feb 2 '16 at 20:43
0

SRV records cannot be used with websites. Browsers don't know how to look up SRV records to fetch a website on a different port from a different IP address from the main DNS A record.

The reason for this is provided by Teddy in Why do browsers not use SRV records?

The RFC for SRV records specifies that it may not be used by pre-existing protocols which did not already specify the use of SRV records in their specifications. I.e. no SRV in the HTTP spec - browsers are, by the SRV standard, prohibited from using it.

This does not prohibit a new HTTP 1.2 standard from specifying the use of SRV records, though. However, Mark Andrews proposed this in April 2007 to the IETF HTTP working group, but got no response.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.