News for hackers. Stuff that matters.
Re:Make Your Own Programming Language by fcanela on Saturday January 03, 2015 @02:39PM (#8831726)
Server not found error when connecting. Tried removing the "-" but didn't work neither.
Re:Make Your Own Programming Language by stringy on Saturday January 03, 2015 @03:30PM (#8831890)
According to RFC 1034[1] hyphens can only be interior to a label; it appears many tools simply follow these recommendations strictly.

The exact wording is: "They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen."

[1]: http://www.ietf.org/rfc/rfc1034.txt

Re:Make Your Own Programming Language by teddyh on Saturday January 03, 2015 @03:53PM (#8831966)
The wording “must start with” doesn’t sound like a “recommendation”, and I would think that these tools are right to interpret the standard strictly, and that Github is wrong to allow such domain names.
Re:Make Your Own Programming Language by poizan42 on Saturday January 03, 2015 @05:18PM (#8832242)
Whatever happened to "be lenient in what you accept, conservative in what you send"?
Re:Make Your Own Programming Language by teddyh on Saturday January 03, 2015 @05:26PM (#8832285)
Github ignores that rule when they emit such domain names. One might make the point that Firefox and others who in turn reject such domain names are not being lenient in what they accept, but since domain names on the edge of acceptability often are a security issue, I think that a strict interpretation of the standard is the safe choice to make here.
Re:Make Your Own Programming Language by MichaelGG on Saturday January 03, 2015 @10:09PM (#8833059)
It's a terrible idea that just causes all sorts of intro l interop problems. Web development, for instance, is a mess because of all the various attempts to interpret stuff in some way, versus just failing.
Re:Make Your Own Programming Language by gue5t on Saturday January 03, 2015 @04:48PM (#8832133)
In glibc's libresolv, this is caused by res_hnok in resolv/res_name.c returning 0:

    /*
     * Verify that a domain name uses an acceptable character set.
     */

    /*
     * Note the conspicuous absence of ctype macros in these definitions.  On
     * non-ASCII hosts, we can't depend on string literals or ctype macros to
     * tell us anything about network-format data.  The rest of the BIND system
     * is not careful about this, but for some reason, we're doing it right here.
     */
    #define PERIOD 0x2e
    #define	hyphenchar(c) ((c) == 0x2d)
    #define	underscorechar(c) ((c) == 0x5f)
    #define bslashchar(c) ((c) == 0x5c)
    #define periodchar(c) ((c) == PERIOD)
    #define asterchar(c) ((c) == 0x2a)
    #define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
		       || ((c) >= 0x61 && (c) <= 0x7a))
    #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)

    #define borderchar(c) (alphachar(c) || digitchar(c))
    #define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
    #define	domainchar(c) ((c) > 0x20 && (c) < 0x7f)

    int
    res_hnok(const char *dn) {
	    int pch = PERIOD, ch = *dn++;

	    while (ch != '\0') {
		    int nch = *dn++;

		    if (periodchar(ch)) {
			    (void)NULL;
		    } else if (periodchar(pch)) {
			    if (!borderchar(ch))
				    return (0);
		    } else if (periodchar(nch) || nch == '\0') {
			    if (!borderchar(ch))
				    return (0);
		    } else {
			    if (!middlechar(ch))
				    return (0);
		    }
		    pch = ch, ch = nch;
	    }
	    return (1);
    }
Re:Make Your Own Programming Language by gue5t on Saturday January 03, 2015 @05:08PM (#8832192)
And the hack fix:

    /*
    hnokpre.c: LD_PRELOAD shim to bypass valid hostname checking in glibc
    gcc -fPIC -shared hnokpre.c -o libhnokpre.so
    LD_PRELOAD=./libhnokpre.so curl http://mattias-.github.io/
    */

    int res_hnok(const char* dn)
    {
        return 1;
    }

    int __res_hnok(const char* dn)
    {
        return 1;
    }
Re:Make Your Own Programming Language by poizan42 on Saturday January 03, 2015 @05:45PM (#8832360)
I'm kinda wondering what's the reason for that that check to begin with. Just being pedantic for pedentrys sake?
Re:Make Your Own Programming Language by poizan42 on Saturday January 03, 2015 @05:43PM (#8832352)

     * Note the conspicuous absence of ctype macros in these definitions.  On
     * non-ASCII hosts, we can't depend on string literals or ctype macros to
     * tell us anything about network-format data.  The rest of the BIND system
     * is not careful about this, but for some reason, we're doing it right here.
Well that is only a problem if the charset is converted to something else. Are there still systems out there without a C compiler that can be told to use ASCII?
Re:Make Your Own Programming Language by Pirate-of-SV on Saturday January 03, 2015 @04:38PM (#8832089)
Author here: This is slightly embarrassing.

I just added a custom domain/CNAME to my github pages so it should be reachable at http://blog.ppelgren.se

Re:Make Your Own Programming Language by fcanela on Saturday January 03, 2015 @06:20PM (#8832447)
Could happen to anyone. Nice job solving it fast.
Re:Make Your Own Programming Language by Hemospectrum on Saturday January 03, 2015 @02:59PM (#8831782)
Apparently the hyphen isn't there by mistake. Here's the blog source repo: https://github.com/Mattias-/Mattias-.github.io

Are you perhaps using a browser or a DNS stack that rejects this type of domain name?

Re:Make Your Own Programming Language by vortico on Saturday January 03, 2015 @03:31PM (#8831894)
I had the same problem, but you can read the page from the Markdown-parsed source. https://github.com/Mattias-/Mattias-.github.io/blob/master/_...
Re:Make Your Own Programming Language by th0br0 on Saturday January 03, 2015 @03:02PM (#8831792)
The question should probably be: which OS are you using?

It's quite interesting... dig seems to resolve the domain just fine, but neither chrome, curl nor firefox seem to be able to open the page. (tested on Fedora/CentOS/Android)

Re:Make Your Own Programming Language by blablablaat on Saturday January 03, 2015 @03:33PM (#8831896)
Same here. My dnsmasq server responds with the domain name when I try it with 'host', but curl and firefox fail on Debian and Ubuntu with only that 1 DNS server in resolv.conf. Curl says "curl: (6) Could not resolve host: mattias-.github.io".

However, curl and firefox seem to be RFC-compliant. RFC952 states: "The last character must not be a minus sign or period."

Re:Make Your Own Programming Language by jwatte on Saturday January 03, 2015 @07:33PM (#8832662)
Android, Google chrome, also have the resolver problem.
Re:Make Your Own Programming Language by randunel on Saturday January 03, 2015 @04:16PM (#8832026)
Ubuntu 14.04 / Chrome + Firefox... same behaviour :( DNS resolves, curl + both browsers fail.

randunel@18:~$ curl Mattias-.github.io

curl: (6) Could not resolve host: Mattias-.github.io

randunel@18:~$ dig +short Mattias-.github.io

github.map.fastly.net.

185.31.18.133

Re:Make Your Own Programming Language by anindyabd on Saturday January 03, 2015 @05:01PM (#8832173)
Interesting... I'm on Ubuntu 14.04 too, and Firefox fails for me, but Chrome succeeds.
Re:Make Your Own Programming Language by steveklabnik on Saturday January 03, 2015 @03:23PM (#8831870)
Firefox on Debian here, also get a "Problem loading page"
Re:Make Your Own Programming Language by cipher0 on Saturday January 03, 2015 @03:29PM (#8831889)
Firefox on Arch, same stuff.

Edit: Google Chrome works.

Re:Make Your Own Programming Language by anaphor on Saturday January 03, 2015 @04:43PM (#8832107)
I got it with curl -I 185.31.18.133 --header "Host: mattias-.github.io"
Re:Make Your Own Programming Language by lelandbatey on Saturday January 03, 2015 @03:41PM (#8831921)
I am also unable to visit the page. I'm on Android 4.2, using Firefox and Chrome.